From 58a0093468932d974aecae6ebfa7c4b0d76f0181 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 12:58:23 +0100 Subject: [PATCH 01/86] CI test --- .github/workflows/python-app.yml | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 00000000..200872cd --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,39 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python application + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest From b784697b18cee6a199ad85ba4b60f1df43506373 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 13:49:50 +0100 Subject: [PATCH 02/86] Update python-app.yml --- .github/workflows/python-app.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 200872cd..53021c70 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,7 +1,7 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python +# This workflow will install Python dependencies and run tests with multiple versions of Python # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: Python application +name: Sanity check on: push: @@ -14,15 +14,19 @@ permissions: jobs: build: - - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-20.04, ubuntu-22.04, windows-2019, macos-12] + python: [3.9, 3.13] steps: - uses: actions/checkout@v4 - - name: Set up Python 3.10 - uses: actions/setup-python@v3 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: ${{ matrix.python }} - name: Install dependencies run: | python -m pip install --upgrade pip From f20fad3caf6c70345e725b4fd021ab5b2c0663e3 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 13:53:19 +0100 Subject: [PATCH 03/86] Update python-app.yml --- .github/workflows/python-app.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 53021c70..3d55898a 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -32,12 +32,3 @@ jobs: python -m pip install --upgrade pip pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest From 37cd5bb8bb78c67d6cecef1609e29588606f48d0 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 13:53:49 +0100 Subject: [PATCH 04/86] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 3d55898a..4a26080f 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-20.04, ubuntu-22.04, windows-2019, macos-12] + os: [ubuntu-latest, windows-latest, macos-latest] python: [3.9, 3.13] steps: From 7ce282cbcb53130f2456851575a3e937a4924ba3 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 14:07:29 +0100 Subject: [PATCH 05/86] Update python-app.yml --- .github/workflows/python-app.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 4a26080f..8e3621ba 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -13,13 +13,30 @@ permissions: contents: read jobs: - build: + find-subprojects: + runs-on: ubuntu-latest + outputs: + subprojects: ${{ steps.get-subprojects.outputs.subproject_list }} + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Get list of subprojects in demos folder + id: get-subprojects + run: | + subprojects=$(find demos/* -maxdepth 0 -type d -exec basename {} \;) + subproject_list=$(echo "$subprojects" | jq -R -s -c 'split("\n")[:-1]') + echo "::set-output name=subproject_list::$subproject_list" + + check: + needs: find-subprojects runs-on: ${{ matrix.os }} strategy: fail-fast: true matrix: os: [ubuntu-latest, windows-latest, macos-latest] python: [3.9, 3.13] + subproject: ${{ fromJson(needs.define-subprojects.outputs.subprojects) }} steps: - uses: actions/checkout@v4 @@ -27,8 +44,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - - name: Install dependencies + - name: Install dependencies for ${{ matrix.subproject }} run: | python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install -r ./demos/${{ matrix.subproject }}/requirements.txt + From 146365e69637248973115b50cb1882a9327952e0 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 14:12:30 +0100 Subject: [PATCH 06/86] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 8e3621ba..52d8626e 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -28,7 +28,7 @@ jobs: subproject_list=$(echo "$subprojects" | jq -R -s -c 'split("\n")[:-1]') echo "::set-output name=subproject_list::$subproject_list" - check: + check-repo: needs: find-subprojects runs-on: ${{ matrix.os }} strategy: From b0554b2bf4abbac3154354f9166d03428b85ec73 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 14:56:40 +0100 Subject: [PATCH 07/86] Update python-app.yml --- .github/workflows/python-app.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 52d8626e..78c07fe3 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -26,8 +26,9 @@ jobs: run: | subprojects=$(find demos/* -maxdepth 0 -type d -exec basename {} \;) subproject_list=$(echo "$subprojects" | jq -R -s -c 'split("\n")[:-1]') - echo "::set-output name=subproject_list::$subproject_list" - + echo "$subproject_list" + echo "subproject_list=$subproject_list" >> $GITHUB_OUTPUT # Use GITHUB_OUTPUT file + check-repo: needs: find-subprojects runs-on: ${{ matrix.os }} From 34604722104f1e7143462bcd572fcfd0f716c48b Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 14:58:05 +0100 Subject: [PATCH 08/86] Update python-app.yml --- .github/workflows/python-app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 78c07fe3..547f14f6 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -27,7 +27,7 @@ jobs: subprojects=$(find demos/* -maxdepth 0 -type d -exec basename {} \;) subproject_list=$(echo "$subprojects" | jq -R -s -c 'split("\n")[:-1]') echo "$subproject_list" - echo "subproject_list=$subproject_list" >> $GITHUB_OUTPUT # Use GITHUB_OUTPUT file + echo "::set-output name=subproject_list::$subproject_list" check-repo: needs: find-subprojects @@ -37,7 +37,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] python: [3.9, 3.13] - subproject: ${{ fromJson(needs.define-subprojects.outputs.subprojects) }} + subproject: ${{ fromJson(needs.find-subprojects.outputs.subprojects) }} steps: - uses: actions/checkout@v4 From 9e1a4de9826716ed9ab7a5a56feba67ee3899b21 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 15:00:39 +0100 Subject: [PATCH 09/86] Update python-app.yml --- .github/workflows/python-app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 547f14f6..34cd31a8 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -24,7 +24,7 @@ jobs: - name: Get list of subprojects in demos folder id: get-subprojects run: | - subprojects=$(find demos/* -maxdepth 0 -type d -exec basename {} \;) + subprojects=$(find demos/* -maxdepth 0 -type d ! -name "utils" -exec basename {} \;) subproject_list=$(echo "$subprojects" | jq -R -s -c 'split("\n")[:-1]') echo "$subproject_list" echo "::set-output name=subproject_list::$subproject_list" @@ -33,7 +33,7 @@ jobs: needs: find-subprojects runs-on: ${{ matrix.os }} strategy: - fail-fast: true + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] python: [3.9, 3.13] From 41ec7c9d85d81e741ab24add042147f354d69939 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 15:01:46 +0100 Subject: [PATCH 10/86] Update python-app.yml --- .github/workflows/python-app.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 34cd31a8..0e64740d 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -21,13 +21,14 @@ jobs: - name: Check out code uses: actions/checkout@v4 - - name: Get list of subprojects in demos folder + - name: Get list of subprojects in demos folder, excluding utils id: get-subprojects run: | + # Find all subdirectories in 'demos' excluding 'utils' and format as JSON array subprojects=$(find demos/* -maxdepth 0 -type d ! -name "utils" -exec basename {} \;) subproject_list=$(echo "$subprojects" | jq -R -s -c 'split("\n")[:-1]') echo "$subproject_list" - echo "::set-output name=subproject_list::$subproject_list" + echo "subproject_list=$subproject_list" >> $GITHUB_OUTPUT # Correctly use GITHUB_OUTPUT file for setting outputs check-repo: needs: find-subprojects @@ -49,4 +50,3 @@ jobs: run: | python -m pip install --upgrade pip pip install -r ./demos/${{ matrix.subproject }}/requirements.txt - From 95d4a7e276649832f71795629f1fb1b8728b6a13 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 15:05:00 +0100 Subject: [PATCH 11/86] Update python-app.yml --- .github/workflows/python-app.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 0e64740d..bc7bdd3d 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -21,14 +21,14 @@ jobs: - name: Check out code uses: actions/checkout@v4 - - name: Get list of subprojects in demos folder, excluding utils + - name: Get list of Python subprojects (with requirements.txt) id: get-subprojects run: | - # Find all subdirectories in 'demos' excluding 'utils' and format as JSON array - subprojects=$(find demos/* -maxdepth 0 -type d ! -name "utils" -exec basename {} \;) + # Find all directories in 'demos' that contain a requirements.txt file, excluding 'utils' + subprojects=$(find . -type f -name "requirements.txt" -exec dirname {} \; | sort -u) subproject_list=$(echo "$subprojects" | jq -R -s -c 'split("\n")[:-1]') echo "$subproject_list" - echo "subproject_list=$subproject_list" >> $GITHUB_OUTPUT # Correctly use GITHUB_OUTPUT file for setting outputs + echo "subproject_list=$subproject_list" >> $GITHUB_OUTPUT # Use GITHUB_OUTPUT file for setting outputs check-repo: needs: find-subprojects From b83393069ed0fa2e43186ad20eb3d2a5d1a9be30 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 15:08:49 +0100 Subject: [PATCH 12/86] Update python-app.yml --- .github/workflows/python-app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index bc7bdd3d..fedeed80 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -24,7 +24,7 @@ jobs: - name: Get list of Python subprojects (with requirements.txt) id: get-subprojects run: | - # Find all directories in 'demos' that contain a requirements.txt file, excluding 'utils' + # Find all directories in repo that contain a requirements.txt file subprojects=$(find . -type f -name "requirements.txt" -exec dirname {} \; | sort -u) subproject_list=$(echo "$subprojects" | jq -R -s -c 'split("\n")[:-1]') echo "$subproject_list" @@ -49,4 +49,4 @@ jobs: - name: Install dependencies for ${{ matrix.subproject }} run: | python -m pip install --upgrade pip - pip install -r ./demos/${{ matrix.subproject }}/requirements.txt + pip install -r ./${{ matrix.subproject }}/requirements.txt From 92352a8131d6f595276aadf7fd13ab667b0130b8 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 15:11:32 +0100 Subject: [PATCH 13/86] Update python-app.yml --- .github/workflows/python-app.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index fedeed80..341754cb 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -37,7 +37,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python: [3.9, 3.13] + python: [3.12] subproject: ${{ fromJson(needs.find-subprojects.outputs.subprojects) }} steps: @@ -46,7 +46,10 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} + - name: Change directory to ${{ matrix.subproject }} + run: | + cd ${{ matrix.subproject }} - name: Install dependencies for ${{ matrix.subproject }} run: | python -m pip install --upgrade pip - pip install -r ./${{ matrix.subproject }}/requirements.txt + pip install -r requirements.txt From 2942021e1dd30c97e5efbc22cf3985516ed25d5e Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 15:13:51 +0100 Subject: [PATCH 14/86] Update python-app.yml --- .github/workflows/python-app.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 341754cb..092162f2 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -29,7 +29,7 @@ jobs: subproject_list=$(echo "$subprojects" | jq -R -s -c 'split("\n")[:-1]') echo "$subproject_list" echo "subproject_list=$subproject_list" >> $GITHUB_OUTPUT # Use GITHUB_OUTPUT file for setting outputs - + check-repo: needs: find-subprojects runs-on: ${{ matrix.os }} @@ -46,10 +46,10 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - - name: Change directory to ${{ matrix.subproject }} - run: | - cd ${{ matrix.subproject }} - name: Install dependencies for ${{ matrix.subproject }} run: | + # Change to the subproject directory + cd ${{ matrix.subproject }} + # Install dependencies python -m pip install --upgrade pip pip install -r requirements.txt From 3f04933d9325d2fdba8ca22b2c2a64bf5ecd3d9e Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 15:16:52 +0100 Subject: [PATCH 15/86] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 092162f2..b32e0c5b 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -37,7 +37,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python: [3.12] + python: [3.11] subproject: ${{ fromJson(needs.find-subprojects.outputs.subprojects) }} steps: From 0a397ffbfa54f7be580cbeb074070ff17f8364e7 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 16:05:45 +0100 Subject: [PATCH 16/86] Update python-app.yml --- .github/workflows/python-app.yml | 41 +++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index b32e0c5b..3afd6a79 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,6 +1,3 @@ -# This workflow will install Python dependencies and run tests with multiple versions of Python -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - name: Sanity check on: @@ -25,7 +22,7 @@ jobs: id: get-subprojects run: | # Find all directories in repo that contain a requirements.txt file - subprojects=$(find . -type f -name "requirements.txt" -exec dirname {} \; | sort -u) + subprojects=$(find demos -type f -name "requirements.txt" -exec dirname {} \; | sort -u) subproject_list=$(echo "$subprojects" | jq -R -s -c 'split("\n")[:-1]') echo "$subproject_list" echo "subproject_list=$subproject_list" >> $GITHUB_OUTPUT # Use GITHUB_OUTPUT file for setting outputs @@ -37,19 +34,47 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python: [3.11] + python: [3.12] subproject: ${{ fromJson(needs.find-subprojects.outputs.subprojects) }} steps: - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} + - name: Install dependencies for ${{ matrix.subproject }} run: | - # Change to the subproject directory - cd ${{ matrix.subproject }} - # Install dependencies + cd demos/${{ matrix.subproject }} python -m pip install --upgrade pip pip install -r requirements.txt + + - name: Download sample video file from artifacts + uses: actions/download-artifact@v4 + with: + name: sample-video-artifact + path: ./sample_video.mp4 # Path where the video will be stored locally + + - name: Check if --stream is a valid option + id: check-stream-option + run: | + cd demos/${{ matrix.subproject }} + if python main.py -h | grep -q -- "--stream"; then + echo "Stream option found" + echo "stream=true" >> $GITHUB_ENV + else + echo "Stream option not found" + echo "stream=false" >> $GITHUB_ENV + fi + + - name: Run the demo (main.py or main.ipynb) + run: | + cd demos/${{ matrix.subproject }} + if [ "${{ env.stream }}" = "true" ]; then + # Run the demo with --stream if it requires video input + python main.py --stream ./sample_video.mp4 + else + # Run the demo without --stream if it does not require video input + python main.py From 513f7dd4ee0bd3f6d3c4969ac8211a9fc64040a4 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 16:10:48 +0100 Subject: [PATCH 17/86] Update python-app.yml --- .github/workflows/python-app.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 3afd6a79..9d5e336e 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -47,7 +47,7 @@ jobs: - name: Install dependencies for ${{ matrix.subproject }} run: | - cd demos/${{ matrix.subproject }} + cd ${{ matrix.subproject }} python -m pip install --upgrade pip pip install -r requirements.txt @@ -60,7 +60,7 @@ jobs: - name: Check if --stream is a valid option id: check-stream-option run: | - cd demos/${{ matrix.subproject }} + cd ${{ matrix.subproject }} if python main.py -h | grep -q -- "--stream"; then echo "Stream option found" echo "stream=true" >> $GITHUB_ENV @@ -71,7 +71,7 @@ jobs: - name: Run the demo (main.py or main.ipynb) run: | - cd demos/${{ matrix.subproject }} + cd ${{ matrix.subproject }} if [ "${{ env.stream }}" = "true" ]; then # Run the demo with --stream if it requires video input python main.py --stream ./sample_video.mp4 From dcbd7d4b2dfce53cc4fb2f78b4ea6355b1bb4e92 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 16:12:47 +0100 Subject: [PATCH 18/86] Update python-app.yml --- .github/workflows/python-app.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 9d5e336e..9fdb4d7b 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -34,7 +34,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python: [3.12] + python: [3.11] subproject: ${{ fromJson(needs.find-subprojects.outputs.subprojects) }} steps: @@ -47,9 +47,8 @@ jobs: - name: Install dependencies for ${{ matrix.subproject }} run: | - cd ${{ matrix.subproject }} python -m pip install --upgrade pip - pip install -r requirements.txt + pip install -r ${{ matrix.subproject }}/requirements.txt - name: Download sample video file from artifacts uses: actions/download-artifact@v4 From 5f6b7aad1041b1a9de19a9020af3f242f354394e Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 16:17:13 +0100 Subject: [PATCH 19/86] Update python-app.yml --- .github/workflows/python-app.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 9fdb4d7b..7ec3c997 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -50,11 +50,10 @@ jobs: python -m pip install --upgrade pip pip install -r ${{ matrix.subproject }}/requirements.txt - - name: Download sample video file from artifacts - uses: actions/download-artifact@v4 - with: - name: sample-video-artifact - path: ./sample_video.mp4 # Path where the video will be stored locally + - name: Download sample video file + run: | + cd ${{ matrix.subproject }} + curl -L -o sample_video.mp4 https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4 - name: Check if --stream is a valid option id: check-stream-option From f07c703048c657250c502a3fa7e5d5ca7d8e6e45 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 16:18:39 +0100 Subject: [PATCH 20/86] Update and rename python-app.yml to sanity-check.yml --- .github/workflows/{python-app.yml => sanity-check.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{python-app.yml => sanity-check.yml} (98%) diff --git a/.github/workflows/python-app.yml b/.github/workflows/sanity-check.yml similarity index 98% rename from .github/workflows/python-app.yml rename to .github/workflows/sanity-check.yml index 7ec3c997..8182a469 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/sanity-check.yml @@ -67,7 +67,7 @@ jobs: echo "stream=false" >> $GITHUB_ENV fi - - name: Run the demo (main.py or main.ipynb) + - name: Run the demo run: | cd ${{ matrix.subproject }} if [ "${{ env.stream }}" = "true" ]; then From 88cd0e30a2a4bfa378f05dcb47811dd2d2278734 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 16:23:43 +0100 Subject: [PATCH 21/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 8182a469..5ee325ee 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -72,7 +72,8 @@ jobs: cd ${{ matrix.subproject }} if [ "${{ env.stream }}" = "true" ]; then # Run the demo with --stream if it requires video input - python main.py --stream ./sample_video.mp4 + python main.py --stream sample_video.mp4 else # Run the demo without --stream if it does not require video input python main.py + fi From 3c5e4b53374f9e406c4d09db79c1550cfdd686e8 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 16:31:56 +0100 Subject: [PATCH 22/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 5ee325ee..e6b2d007 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -50,6 +50,16 @@ jobs: python -m pip install --upgrade pip pip install -r ${{ matrix.subproject }}/requirements.txt + - name: Install Xvfb (Virtual Display) + run: | + sudo apt-get update + sudo apt-get install -y xvfb + + - name: Set up Virtual Display + run: | + export DISPLAY=:99.0 + Xvfb :99 -screen 0 1024x768x16 & # Start the virtual display + - name: Download sample video file run: | cd ${{ matrix.subproject }} From 49227325e45fa39b35afa10e353e8b33f5905369 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 16:34:23 +0100 Subject: [PATCH 23/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index e6b2d007..8ec56ea8 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -39,17 +39,7 @@ jobs: steps: - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python }} - - - name: Install dependencies for ${{ matrix.subproject }} - run: | - python -m pip install --upgrade pip - pip install -r ${{ matrix.subproject }}/requirements.txt - + - name: Install Xvfb (Virtual Display) run: | sudo apt-get update @@ -60,6 +50,17 @@ jobs: export DISPLAY=:99.0 Xvfb :99 -screen 0 1024x768x16 & # Start the virtual display + + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Install dependencies for ${{ matrix.subproject }} + run: | + python -m pip install --upgrade pip + pip install -r ${{ matrix.subproject }}/requirements.txt + - name: Download sample video file run: | cd ${{ matrix.subproject }} From 59f354cb4157a965f5f73dc9350e5a1ac87392c2 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 16:39:37 +0100 Subject: [PATCH 24/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 8ec56ea8..cd6cf8c0 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -39,17 +39,6 @@ jobs: steps: - uses: actions/checkout@v4 - - - name: Install Xvfb (Virtual Display) - run: | - sudo apt-get update - sudo apt-get install -y xvfb - - - name: Set up Virtual Display - run: | - export DISPLAY=:99.0 - Xvfb :99 -screen 0 1024x768x16 & # Start the virtual display - - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v5 From c2ecdc2b75ceaab07bad4745947de7981be0e083 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 16:43:38 +0100 Subject: [PATCH 25/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index cd6cf8c0..405450f9 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -49,6 +49,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r ${{ matrix.subproject }}/requirements.txt + pip list - name: Download sample video file run: | From 6d59727b0fe2a5e36ad926158a16093761e5333f Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 16:59:10 +0100 Subject: [PATCH 26/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 405450f9..6b4357d9 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -49,7 +49,6 @@ jobs: run: | python -m pip install --upgrade pip pip install -r ${{ matrix.subproject }}/requirements.txt - pip list - name: Download sample video file run: | @@ -68,6 +67,11 @@ jobs: echo "stream=false" >> $GITHUB_ENV fi + - name: Set environment to avoid OpenCV GUI errors + run: | + # This will prevent OpenCV from trying to display any GUI windows during execution + echo "DISPLAY=:99" >> $GITHUB_ENV + - name: Run the demo run: | cd ${{ matrix.subproject }} From cb243da659b3d8e7a4e909944e2c441f0ed86c96 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 16:59:47 +0100 Subject: [PATCH 27/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 6b4357d9..efc90489 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -49,6 +49,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r ${{ matrix.subproject }}/requirements.txt + pip list - name: Download sample video file run: | From 137bf60044ef8e4b4816c81e433ccd8ea88f882a Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 17:02:36 +0100 Subject: [PATCH 28/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index efc90489..5e431ec6 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -37,6 +37,9 @@ jobs: python: [3.11] subproject: ${{ fromJson(needs.find-subprojects.outputs.subprojects) }} + env: + DISPLAY: ":99" # Set the DISPLAY variable for all steps in this job + steps: - uses: actions/checkout@v4 @@ -68,11 +71,6 @@ jobs: echo "stream=false" >> $GITHUB_ENV fi - - name: Set environment to avoid OpenCV GUI errors - run: | - # This will prevent OpenCV from trying to display any GUI windows during execution - echo "DISPLAY=:99" >> $GITHUB_ENV - - name: Run the demo run: | cd ${{ matrix.subproject }} From 71d7378c4d4eef670c464ef896769e2c6ed9f830 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Nov 2024 17:05:17 +0100 Subject: [PATCH 29/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 5e431ec6..65dd0d0c 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -36,10 +36,7 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] python: [3.11] subproject: ${{ fromJson(needs.find-subprojects.outputs.subprojects) }} - - env: - DISPLAY: ":99" # Set the DISPLAY variable for all steps in this job - + steps: - uses: actions/checkout@v4 From da8250674ccd3f4ad6c44457cf3f670d8c2b1df9 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 15:38:09 +0100 Subject: [PATCH 30/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 173 ++++++++++++++++++++--------- 1 file changed, 122 insertions(+), 51 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 65dd0d0c..901274a0 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -9,72 +9,143 @@ on: permissions: contents: read +env: + OS_LIST: ubuntu-latest,windows-latest,macos-latest + PYTHON_VERSIONS: 3.11 + jobs: find-subprojects: runs-on: ubuntu-latest outputs: - subprojects: ${{ steps.get-subprojects.outputs.subproject_list }} + notebook: ${{ steps.categorize-subprojects.outputs.notebook }} + gradio: ${{ steps.categorize-subprojects.outputs.gradio }} + webcam: ${{ steps.categorize-subprojects.outputs.webcam }} + js: ${{ steps.categorize-subprojects.outputs.js }} steps: - name: Check out code uses: actions/checkout@v4 - - name: Get list of Python subprojects (with requirements.txt) - id: get-subprojects + - name: Categorize subprojects + id: categorize-subprojects run: | - # Find all directories in repo that contain a requirements.txt file - subprojects=$(find demos -type f -name "requirements.txt" -exec dirname {} \; | sort -u) - subproject_list=$(echo "$subprojects" | jq -R -s -c 'split("\n")[:-1]') - echo "$subproject_list" - echo "subproject_list=$subproject_list" >> $GITHUB_OUTPUT # Use GITHUB_OUTPUT file for setting outputs + notebook=() + gradio=() + webcam=() + js=() + + for dir in $(find demos -type f -name "requirements.txt" -exec dirname {} \; | sort -u); do + if [ -f "$dir/main.ipynb" ]; then + notebook+=("$dir") + elif grep -q "gradio" "$dir/requirements.txt"; then + gradio+=("$dir") + elif [ -f "$dir/package.json" ]; then + js+=("$dir") + elif python $dir/main.py -h 2>/dev/null | grep -q -- "--stream"; then + webcam+=("$dir") + fi + done + + notebook_json=$(printf '%s\n' "${notebook[@]}" | jq -R -s -c 'split("\n")[:-1]') + gradio_json=$(printf '%s\n' "${gradio[@]}" | jq -R -s -c 'split("\n")[:-1]') + webcam_json=$(printf '%s\n' "${webcam[@]}" | jq -R -s -c 'split("\n")[:-1]') + js_json=$(printf '%s\n' "${js[@]}" | jq -R -s -c 'split("\n")[:-1]') + + echo "notebook=$notebook_json" >> $GITHUB_OUTPUT + echo "gradio=$gradio_json" >> $GITHUB_OUTPUT + echo "webcam=$webcam_json" >> $GITHUB_OUTPUT + echo "js=$js_json" >> $GITHUB_OUTPUT - check-repo: + notebook: needs: find-subprojects runs-on: ${{ matrix.os }} strategy: - fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python: [3.11] - subproject: ${{ fromJson(needs.find-subprojects.outputs.subprojects) }} - + os: ${{ fromJson(env.OS_LIST) }} + python: ${{ fromJson(env.PYTHON_VERSIONS) }} + subproject: ${{ fromJson(needs.find-subprojects.outputs.notebook) }} steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python }} - - - name: Install dependencies for ${{ matrix.subproject }} - run: | - python -m pip install --upgrade pip - pip install -r ${{ matrix.subproject }}/requirements.txt - pip list - - - name: Download sample video file - run: | - cd ${{ matrix.subproject }} - curl -L -o sample_video.mp4 https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4 + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r ${{ matrix.subproject }}/requirements.txt + - name: Execute Notebook + run: | + cd ${{ matrix.subproject }} + jupyter nbconvert --to notebook --execute main.ipynb - - name: Check if --stream is a valid option - id: check-stream-option - run: | - cd ${{ matrix.subproject }} - if python main.py -h | grep -q -- "--stream"; then - echo "Stream option found" - echo "stream=true" >> $GITHUB_ENV - else - echo "Stream option not found" - echo "stream=false" >> $GITHUB_ENV - fi + gradio: + needs: find-subprojects + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ${{ fromJson(env.OS_LIST) }} + python: ${{ fromJson(env.PYTHON_VERSIONS) }} + subproject: ${{ fromJson(needs.find-subprojects.outputs.gradio) }} + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r ${{ matrix.subproject }}/requirements.txt + - name: Run Gradio App + run: | + cd ${{ matrix.subproject }} + python main.py - - name: Run the demo - run: | - cd ${{ matrix.subproject }} - if [ "${{ env.stream }}" = "true" ]; then - # Run the demo with --stream if it requires video input + webcam: + needs: find-subprojects + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ${{ fromJson(env.OS_LIST) }} + python: ${{ fromJson(env.PYTHON_VERSIONS) }} + subproject: ${{ fromJson(needs.find-subprojects.outputs.webcam) }} + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r ${{ matrix.subproject }}/requirements.txt + - name: Download sample video file + run: | + cd ${{ matrix.subproject }} + curl -L -o sample_video.mp4 https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4 + - name: Run Webcam Demo + run: | + cd ${{ matrix.subproject }} python main.py --stream sample_video.mp4 - else - # Run the demo without --stream if it does not require video input - python main.py - fi + + js: + needs: find-subprojects + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ${{ fromJson(env.OS_LIST) }} + subproject: ${{ fromJson(needs.find-subprojects.outputs.js) }} + steps: + - uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + - name: Install dependencies + run: | + cd ${{ matrix.subproject }} + npm install + - name: Run JS Project + run: | + cd ${{ matrix.subproject }} + npm run start From f69c27a097a6605feece23431c7c3af2967073c2 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 15:38:59 +0100 Subject: [PATCH 31/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 901274a0..df3b5b03 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -11,7 +11,7 @@ permissions: env: OS_LIST: ubuntu-latest,windows-latest,macos-latest - PYTHON_VERSIONS: 3.11 + PYTHON_VERSIONS: "3.11" jobs: find-subprojects: From 91d93d6f3d3e6792dd12367b8a3099ce54683419 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 15:39:41 +0100 Subject: [PATCH 32/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index df3b5b03..76043556 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -11,7 +11,7 @@ permissions: env: OS_LIST: ubuntu-latest,windows-latest,macos-latest - PYTHON_VERSIONS: "3.11" + PYTHON_VERSIONS: '["3.11"]' jobs: find-subprojects: From a31716c1d7aeaed8121cdccefd47e757022dcbc6 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 15:41:48 +0100 Subject: [PATCH 33/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 76043556..f54f6dcd 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -10,8 +10,9 @@ permissions: contents: read env: - OS_LIST: ubuntu-latest,windows-latest,macos-latest - PYTHON_VERSIONS: '["3.11"]' + OS_LIST: ["ubuntu-latest", "windows-latest", "macos-latest"] + PYTHON_VERSIONS: ["3.11"] + jobs: find-subprojects: From f882541b8e271e3b03b801cc92a5fcfba623841a Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 15:42:29 +0100 Subject: [PATCH 34/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index f54f6dcd..98669fce 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -10,8 +10,8 @@ permissions: contents: read env: - OS_LIST: ["ubuntu-latest", "windows-latest", "macos-latest"] - PYTHON_VERSIONS: ["3.11"] + OS_LIST: '["ubuntu-latest", "windows-latest", "macos-latest"]' + PYTHON_VERSIONS: '["3.11"]' jobs: From 06146bc266dc449ffb8b7692f3438c1505a1d90c Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 15:50:24 +0100 Subject: [PATCH 35/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 98669fce..50046255 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -10,9 +10,8 @@ permissions: contents: read env: - OS_LIST: '["ubuntu-latest", "windows-latest", "macos-latest"]' - PYTHON_VERSIONS: '["3.11"]' - + OS_LIST: "ubuntu-latest, windows-latest, macos-latest" + PYTHON_VERSIONS: "3.11" jobs: find-subprojects: From c871055325b1d831072e61d86279d56af7c16680 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 15:51:54 +0100 Subject: [PATCH 36/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 50046255..cb066516 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -10,7 +10,7 @@ permissions: contents: read env: - OS_LIST: "ubuntu-latest, windows-latest, macos-latest" + OS_LIST: "ubuntu-latest,windows-latest,macos-latest" PYTHON_VERSIONS: "3.11" jobs: From e9a4db5b89af165cb137771058c5d5847a91a771 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 15:58:03 +0100 Subject: [PATCH 37/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index cb066516..743bb987 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -9,10 +9,6 @@ on: permissions: contents: read -env: - OS_LIST: "ubuntu-latest,windows-latest,macos-latest" - PYTHON_VERSIONS: "3.11" - jobs: find-subprojects: runs-on: ubuntu-latest @@ -57,11 +53,12 @@ jobs: notebook: needs: find-subprojects + if: ${{ needs.find-subprojects.outputs.notebook != '[]' }} runs-on: ${{ matrix.os }} strategy: matrix: - os: ${{ fromJson(env.OS_LIST) }} - python: ${{ fromJson(env.PYTHON_VERSIONS) }} + os: [ubuntu-latest, windows-latest, macos-latest] + python: [3.11] subproject: ${{ fromJson(needs.find-subprojects.outputs.notebook) }} steps: - uses: actions/checkout@v4 @@ -80,11 +77,12 @@ jobs: gradio: needs: find-subprojects + if: ${{ needs.find-subprojects.outputs.gradio != '[]' }} runs-on: ${{ matrix.os }} strategy: matrix: - os: ${{ fromJson(env.OS_LIST) }} - python: ${{ fromJson(env.PYTHON_VERSIONS) }} + os: [ubuntu-latest, windows-latest, macos-latest] + python: [3.11] subproject: ${{ fromJson(needs.find-subprojects.outputs.gradio) }} steps: - uses: actions/checkout@v4 @@ -103,11 +101,12 @@ jobs: webcam: needs: find-subprojects + if: ${{ needs.find-subprojects.outputs.webcam != '[]' }} runs-on: ${{ matrix.os }} strategy: matrix: - os: ${{ fromJson(env.OS_LIST) }} - python: ${{ fromJson(env.PYTHON_VERSIONS) }} + os: [ubuntu-latest, windows-latest, macos-latest] + python: [3.11] subproject: ${{ fromJson(needs.find-subprojects.outputs.webcam) }} steps: - uses: actions/checkout@v4 @@ -130,10 +129,11 @@ jobs: js: needs: find-subprojects + if: ${{ needs.find-subprojects.outputs.js != '[]' }} runs-on: ${{ matrix.os }} strategy: matrix: - os: ${{ fromJson(env.OS_LIST) }} + os: [ubuntu-latest, windows-latest, macos-latest] subproject: ${{ fromJson(needs.find-subprojects.outputs.js) }} steps: - uses: actions/checkout@v4 From e9f6b4b09d51be0f30016789646fc917c3f1471f Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 18:21:18 +0100 Subject: [PATCH 38/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 743bb987..2f5c97bf 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -70,6 +70,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r ${{ matrix.subproject }}/requirements.txt + pip list - name: Execute Notebook run: | cd ${{ matrix.subproject }} @@ -94,6 +95,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r ${{ matrix.subproject }}/requirements.txt + pip list - name: Run Gradio App run: | cd ${{ matrix.subproject }} @@ -118,6 +120,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r ${{ matrix.subproject }}/requirements.txt + pip list - name: Download sample video file run: | cd ${{ matrix.subproject }} From 887164e0262d2e08ed0907f05b3e799def09c950 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 18:23:13 +0100 Subject: [PATCH 39/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 2f5c97bf..7456f28b 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -46,10 +46,10 @@ jobs: webcam_json=$(printf '%s\n' "${webcam[@]}" | jq -R -s -c 'split("\n")[:-1]') js_json=$(printf '%s\n' "${js[@]}" | jq -R -s -c 'split("\n")[:-1]') - echo "notebook=$notebook_json" >> $GITHUB_OUTPUT - echo "gradio=$gradio_json" >> $GITHUB_OUTPUT - echo "webcam=$webcam_json" >> $GITHUB_OUTPUT - echo "js=$js_json" >> $GITHUB_OUTPUT + echo "notebook=$notebook_json" | tee -a $GITHUB_OUTPUT + echo "gradio=$gradio_json" | tee -a $GITHUB_OUTPUT + echo "webcam=$webcam_json" | tee -a $GITHUB_OUTPUT + echo "js=$js_json" | tee -a $GITHUB_OUTPUT notebook: needs: find-subprojects From cdd8734b0791b2138d9b9b0792805678200696b9 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 18:29:30 +0100 Subject: [PATCH 40/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 7456f28b..e2bacd38 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -29,7 +29,7 @@ jobs: webcam=() js=() - for dir in $(find demos -type f -name "requirements.txt" -exec dirname {} \; | sort -u); do + for dir in $(find demos -type d); do if [ -f "$dir/main.ipynb" ]; then notebook+=("$dir") elif grep -q "gradio" "$dir/requirements.txt"; then From 7befa76f3d174187787158a01efd2771af659a14 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 18:31:55 +0100 Subject: [PATCH 41/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index e2bacd38..ae4e1cc4 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -30,12 +30,12 @@ jobs: js=() for dir in $(find demos -type d); do - if [ -f "$dir/main.ipynb" ]; then + if [ -f "$dir/package.json" ]; then + js+=("$dir") + elif [ -f "$dir/main.ipynb" ]; then notebook+=("$dir") elif grep -q "gradio" "$dir/requirements.txt"; then gradio+=("$dir") - elif [ -f "$dir/package.json" ]; then - js+=("$dir") elif python $dir/main.py -h 2>/dev/null | grep -q -- "--stream"; then webcam+=("$dir") fi From 5113b94d9b22475961a585a3a8c0bbeb18a63160 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 18:33:02 +0100 Subject: [PATCH 42/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index ae4e1cc4..717994e9 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -29,7 +29,7 @@ jobs: webcam=() js=() - for dir in $(find demos -type d); do + for dir in $(find demos -type d -maxdepth 0); do if [ -f "$dir/package.json" ]; then js+=("$dir") elif [ -f "$dir/main.ipynb" ]; then From c8e526d91c764d226067defd4710dbf4292938ec Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 18:35:38 +0100 Subject: [PATCH 43/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 717994e9..c9e455b1 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -29,7 +29,7 @@ jobs: webcam=() js=() - for dir in $(find demos -type d -maxdepth 0); do + for dir in $(find demos -type d -depth 1 ! -name utils); do if [ -f "$dir/package.json" ]; then js+=("$dir") elif [ -f "$dir/main.ipynb" ]; then From 40e873c6a73dfca32fdafe2bfab4f87414fb4483 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 18:38:03 +0100 Subject: [PATCH 44/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index c9e455b1..834fbc79 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -29,7 +29,7 @@ jobs: webcam=() js=() - for dir in $(find demos -type d -depth 1 ! -name utils); do + for dir in $(find demos -type d -maxdepth 1 ! -name utils); do if [ -f "$dir/package.json" ]; then js+=("$dir") elif [ -f "$dir/main.ipynb" ]; then From 3effebb897af4d6e8980030add3978de1f047676 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 18:41:32 +0100 Subject: [PATCH 45/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 834fbc79..7d49a54c 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -29,7 +29,7 @@ jobs: webcam=() js=() - for dir in $(find demos -type d -maxdepth 1 ! -name utils); do + for dir in $(find demos -type d -mindepth 1 -maxdepth 1 ! -name utils); do if [ -f "$dir/package.json" ]; then js+=("$dir") elif [ -f "$dir/main.ipynb" ]; then From 4c3456b55f803341273f3a94fb342f90e6097d3c Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 18:45:57 +0100 Subject: [PATCH 46/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 7d49a54c..b37c00f6 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -36,8 +36,13 @@ jobs: notebook+=("$dir") elif grep -q "gradio" "$dir/requirements.txt"; then gradio+=("$dir") - elif python $dir/main.py -h 2>/dev/null | grep -q -- "--stream"; then - webcam+=("$dir") + elif [ -f "$dir/main.py" ]; then + echo "Checking $dir/main.py for --stream" + if python $dir/main.py -h 2>/dev/null | grep -q -- "--stream"; then + webcam+=("$dir") + else + echo "$dir/main.py does not support --stream" + fi fi done From 0b9f32c11935793a36173028f4a5ba8d9e21999b Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 18:50:23 +0100 Subject: [PATCH 47/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index b37c00f6..4ad88a32 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -36,13 +36,8 @@ jobs: notebook+=("$dir") elif grep -q "gradio" "$dir/requirements.txt"; then gradio+=("$dir") - elif [ -f "$dir/main.py" ]; then - echo "Checking $dir/main.py for --stream" - if python $dir/main.py -h 2>/dev/null | grep -q -- "--stream"; then - webcam+=("$dir") - else - echo "$dir/main.py does not support --stream" - fi + elif python $dir/main.py -h | grep -q "--stream"; then + webcam+=("$dir") fi done From 6b0cac604614300eaebd5d7f2aaff4b836451c12 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 18:53:20 +0100 Subject: [PATCH 48/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 4ad88a32..38e09efd 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -36,7 +36,7 @@ jobs: notebook+=("$dir") elif grep -q "gradio" "$dir/requirements.txt"; then gradio+=("$dir") - elif python $dir/main.py -h | grep -q "--stream"; then + elif grep -q "--stream" "$dir/main.py"; then webcam+=("$dir") fi done From f55d40151326fd03cb72869832fb62b6f1d43a97 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Fri, 15 Nov 2024 18:56:33 +0100 Subject: [PATCH 49/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 38e09efd..d2560aeb 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -36,7 +36,7 @@ jobs: notebook+=("$dir") elif grep -q "gradio" "$dir/requirements.txt"; then gradio+=("$dir") - elif grep -q "--stream" "$dir/main.py"; then + elif grep -q -- "--stream" "$dir/main.py"; then webcam+=("$dir") fi done From 54f84ce2afd9b0512dfcc5f0e76cec69484ee60e Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 21 Nov 2024 11:25:40 +0100 Subject: [PATCH 50/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index d2560aeb..ad10138f 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -56,6 +56,7 @@ jobs: if: ${{ needs.find-subprojects.outputs.notebook != '[]' }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] python: [3.11] @@ -81,6 +82,7 @@ jobs: if: ${{ needs.find-subprojects.outputs.gradio != '[]' }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] python: [3.11] @@ -106,6 +108,7 @@ jobs: if: ${{ needs.find-subprojects.outputs.webcam != '[]' }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] python: [3.11] @@ -135,6 +138,7 @@ jobs: if: ${{ needs.find-subprojects.outputs.js != '[]' }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] subproject: ${{ fromJson(needs.find-subprojects.outputs.js) }} From 2b8a8d57aa0d7e38e58f6db39d4144ccdedc1aea Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 21 Nov 2024 11:40:50 +0100 Subject: [PATCH 51/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index ad10138f..a0963fb1 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -155,4 +155,4 @@ jobs: - name: Run JS Project run: | cd ${{ matrix.subproject }} - npm run start + npm start From e4932dab9cdffc2dc2cbef5395102c70cd8b2169 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 21 Nov 2024 11:44:22 +0100 Subject: [PATCH 52/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index a0963fb1..2bc092b9 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -123,6 +123,8 @@ jobs: run: | python -m pip install --upgrade pip pip install -r ${{ matrix.subproject }}/requirements.txt + # needed for UI + pip install pyqt5 pip list - name: Download sample video file run: | From 27e88c2c69e4723aeaad3c532ca5cde19a67c4f0 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 21 Nov 2024 12:17:21 +0100 Subject: [PATCH 53/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 2bc092b9..3c20b562 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -119,12 +119,14 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - - name: Install dependencies + - name: Install virtual display + run: | + sudo apt-get update + sudo apt-get install -y xvfb + - name: Install python dependencies run: | python -m pip install --upgrade pip pip install -r ${{ matrix.subproject }}/requirements.txt - # needed for UI - pip install pyqt5 pip list - name: Download sample video file run: | @@ -133,7 +135,7 @@ jobs: - name: Run Webcam Demo run: | cd ${{ matrix.subproject }} - python main.py --stream sample_video.mp4 + xvfb-run python main.py --stream sample_video.mp4 js: needs: find-subprojects From b69fe9a11ea6eeef43629d1b85cd08560fd2ce58 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 21 Nov 2024 12:25:23 +0100 Subject: [PATCH 54/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 3c20b562..2e7ea726 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -121,8 +121,10 @@ jobs: python-version: ${{ matrix.python }} - name: Install virtual display run: | - sudo apt-get update - sudo apt-get install -y xvfb + if [[ "${{ runner.os }}" == "Linux" ]]; then + sudo apt-get update + sudo apt-get install -y xvfb + fi - name: Install python dependencies run: | python -m pip install --upgrade pip From 5d4cedf3092e7de321c904afee936b1313e13a13 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 21 Nov 2024 18:11:26 +0100 Subject: [PATCH 55/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 2e7ea726..3a708b17 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -120,11 +120,10 @@ jobs: with: python-version: ${{ matrix.python }} - name: Install virtual display + if: runner.os == 'Linux' run: | - if [[ "${{ runner.os }}" == "Linux" ]]; then - sudo apt-get update - sudo apt-get install -y xvfb - fi + sudo apt-get update + sudo apt-get install -y xvfb - name: Install python dependencies run: | python -m pip install --upgrade pip From c9436cdf5b45af31b9a1a3d0490ed122a3bbc2d8 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 21 Nov 2024 18:15:09 +0100 Subject: [PATCH 56/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 3a708b17..0828e056 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -136,7 +136,7 @@ jobs: - name: Run Webcam Demo run: | cd ${{ matrix.subproject }} - xvfb-run python main.py --stream sample_video.mp4 + python main.py --stream sample_video.mp4 js: needs: find-subprojects From f433c022ee7ccbaf644465e882a5a0145fb44013 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 21 Nov 2024 18:26:20 +0100 Subject: [PATCH 57/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 0828e056..d681782f 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -135,9 +135,13 @@ jobs: curl -L -o sample_video.mp4 https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4 - name: Run Webcam Demo run: | - cd ${{ matrix.subproject }} - python main.py --stream sample_video.mp4 - + # linux requires virtual display + if [ "${{ runner.os }}" == "Linux" ]; then + xvfb-run python main.py --stream sample_video.mp4 + else + python main.py --stream sample_video.mp4 + fi + js: needs: find-subprojects if: ${{ needs.find-subprojects.outputs.js != '[]' }} From 99b0e1391c7c59564c9e0a5fd0b9a753f7b5681a Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 21 Nov 2024 18:29:01 +0100 Subject: [PATCH 58/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index d681782f..8b87d2dc 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -134,6 +134,7 @@ jobs: cd ${{ matrix.subproject }} curl -L -o sample_video.mp4 https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4 - name: Run Webcam Demo + shell: bash run: | # linux requires virtual display if [ "${{ runner.os }}" == "Linux" ]; then From f70a0e4ce13cabe610e3c918fd98af503d7d938b Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 21 Nov 2024 18:31:09 +0100 Subject: [PATCH 59/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 8b87d2dc..404984bf 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -136,6 +136,7 @@ jobs: - name: Run Webcam Demo shell: bash run: | + cd ${{ matrix.subproject }} # linux requires virtual display if [ "${{ runner.os }}" == "Linux" ]; then xvfb-run python main.py --stream sample_video.mp4 From 079cf0ac1753e684c3657734ddad39c9250228bc Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 21 Nov 2024 18:39:56 +0100 Subject: [PATCH 60/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 404984bf..9385fb57 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -99,6 +99,7 @@ jobs: pip install -r ${{ matrix.subproject }}/requirements.txt pip list - name: Run Gradio App + timeout-minutes: 1 run: | cd ${{ matrix.subproject }} python main.py From 961ad0df2b2f599fd42f457acefc8c025e97f778 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 21 Nov 2024 18:45:02 +0100 Subject: [PATCH 61/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 9385fb57..8b667533 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -99,7 +99,6 @@ jobs: pip install -r ${{ matrix.subproject }}/requirements.txt pip list - name: Run Gradio App - timeout-minutes: 1 run: | cd ${{ matrix.subproject }} python main.py @@ -156,6 +155,11 @@ jobs: subproject: ${{ fromJson(needs.find-subprojects.outputs.js) }} steps: - uses: actions/checkout@v4 + - name: Install virtual display + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y xvfb - name: Install Node.js uses: actions/setup-node@v4 with: @@ -167,4 +171,9 @@ jobs: - name: Run JS Project run: | cd ${{ matrix.subproject }} - npm start + # linux requires virtual display + if [ "${{ runner.os }}" == "Linux" ]; then + xvfb-run npm start + else + npm start + fi From ab91b5e83e0ff1ebf1991383678d9f291822a017 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 21 Nov 2024 18:50:54 +0100 Subject: [PATCH 62/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 8b667533..f1b004ab 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -137,7 +137,7 @@ jobs: shell: bash run: | cd ${{ matrix.subproject }} - # linux requires virtual display + # linux requires a virtual display if [ "${{ runner.os }}" == "Linux" ]; then xvfb-run python main.py --stream sample_video.mp4 else @@ -169,9 +169,10 @@ jobs: cd ${{ matrix.subproject }} npm install - name: Run JS Project + shell: bash run: | cd ${{ matrix.subproject }} - # linux requires virtual display + # linux requires a virtual display if [ "${{ runner.os }}" == "Linux" ]; then xvfb-run npm start else From 7caf02fcacb63b76f9ca4813622c8c740d956f3c Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 11:21:29 +0100 Subject: [PATCH 63/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index f1b004ab..c36d26dc 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -174,7 +174,7 @@ jobs: cd ${{ matrix.subproject }} # linux requires a virtual display if [ "${{ runner.os }}" == "Linux" ]; then - xvfb-run npm start + timeout 1 xvfb-run npm start else - npm start + timeout 1 npm start fi From 436df176a2816a7e70bc658ca4b1fece9786aedf Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 11:29:05 +0100 Subject: [PATCH 64/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index c36d26dc..64ae96a2 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -160,6 +160,10 @@ jobs: run: | sudo apt-get update sudo apt-get install -y xvfb + - name: Install coreutils + if: runner.is == 'macOS' + run: | + brew install coreutils - name: Install Node.js uses: actions/setup-node@v4 with: @@ -174,7 +178,7 @@ jobs: cd ${{ matrix.subproject }} # linux requires a virtual display if [ "${{ runner.os }}" == "Linux" ]; then - timeout 1 xvfb-run npm start + timeout 1 xvfb-run npm start || [[ $? v-eq 124 ]] else - timeout 1 npm start + timeout 1 npm start || [[ $? v-eq 124 ]] fi From 38306bd824e161a4c7ccd6f68f42aa7d14691d6f Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 11:29:18 +0100 Subject: [PATCH 65/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 64ae96a2..1609f0c6 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -178,7 +178,7 @@ jobs: cd ${{ matrix.subproject }} # linux requires a virtual display if [ "${{ runner.os }}" == "Linux" ]; then - timeout 1 xvfb-run npm start || [[ $? v-eq 124 ]] + timeout 1 xvfb-run npm start || [[ $? -eq 124 ]] else - timeout 1 npm start || [[ $? v-eq 124 ]] + timeout 1 npm start || [[ $? -eq 124 ]] fi From dbe82a743c394b3ca1cdf6793ca05ef46bef97c7 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 11:33:16 +0100 Subject: [PATCH 66/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 1609f0c6..3c5e95be 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -161,7 +161,7 @@ jobs: sudo apt-get update sudo apt-get install -y xvfb - name: Install coreutils - if: runner.is == 'macOS' + if: runner.os == 'macOS' run: | brew install coreutils - name: Install Node.js @@ -178,7 +178,8 @@ jobs: cd ${{ matrix.subproject }} # linux requires a virtual display if [ "${{ runner.os }}" == "Linux" ]; then - timeout 1 xvfb-run npm start || [[ $? -eq 124 ]] + # the timeout trick "gracefully" kills the app after 1 minute (waiting for user input otherwise) + timeout 1m xvfb-run npm start || [[ $? -eq 124 ]] else - timeout 1 npm start || [[ $? -eq 124 ]] + timeout 1m npm start || [[ $? -eq 124 ]] fi From d8d872b2ad30ea68bbd948fd7bed9f988197c127 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 11:40:03 +0100 Subject: [PATCH 67/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 3c5e95be..a4eda058 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -89,6 +89,10 @@ jobs: subproject: ${{ fromJson(needs.find-subprojects.outputs.gradio) }} steps: - uses: actions/checkout@v4 + - name: Install coreutils + if: runner.os == 'macOS' + run: | + brew install coreutils - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v5 with: @@ -101,7 +105,8 @@ jobs: - name: Run Gradio App run: | cd ${{ matrix.subproject }} - python main.py + # the timeout trick "gracefully" kills the app after 5 minutes (waiting for user input otherwise) + timeout 5m python main.py || [[ $? -eq 124 ]] webcam: needs: find-subprojects From 865413a77c2ac9ae27af6fcc58d015601340c821 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 12:04:22 +0100 Subject: [PATCH 68/86] Added more yaml configs --- .github/workflows/setup-os.yml | 0 .github/workflows/setup-python.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/setup-os.yml create mode 100644 .github/workflows/setup-python.yml diff --git a/.github/workflows/setup-os.yml b/.github/workflows/setup-os.yml new file mode 100644 index 00000000..e69de29b diff --git a/.github/workflows/setup-python.yml b/.github/workflows/setup-python.yml new file mode 100644 index 00000000..e69de29b From 10397ca9f6035740fec35af30d11f728e71ea776 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 12:10:11 +0100 Subject: [PATCH 69/86] Update setup-os.yml --- .github/workflows/setup-os.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/setup-os.yml b/.github/workflows/setup-os.yml index e69de29b..248ee2a3 100644 --- a/.github/workflows/setup-os.yml +++ b/.github/workflows/setup-os.yml @@ -0,0 +1,14 @@ +name: OS setup + +runs: + using: 'composite' + steps: + - name: Install coreutils + if: runner.os == 'macOS' + run: | + brew install coreutils + - name: Install virtual display + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y xvfb From a1a9ce3af7e150fdaf57f44b9a6c11cb9be67314 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 12:11:11 +0100 Subject: [PATCH 70/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index a4eda058..12a1f66a 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -89,10 +89,7 @@ jobs: subproject: ${{ fromJson(needs.find-subprojects.outputs.gradio) }} steps: - uses: actions/checkout@v4 - - name: Install coreutils - if: runner.os == 'macOS' - run: | - brew install coreutils + - uses: ./.github/setup-os - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v5 with: From 6ea95db16d65298f86a8f21f32a848d003856dba Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 12:14:08 +0100 Subject: [PATCH 71/86] Refactored --- .../setup-os.yml => setup-os/action.yml} | 28 +++++++++---------- .../action.yml} | 0 2 files changed, 14 insertions(+), 14 deletions(-) rename .github/{workflows/setup-os.yml => setup-os/action.yml} (95%) rename .github/{workflows/setup-python.yml => setup-python/action.yml} (100%) diff --git a/.github/workflows/setup-os.yml b/.github/setup-os/action.yml similarity index 95% rename from .github/workflows/setup-os.yml rename to .github/setup-os/action.yml index 248ee2a3..63a96b67 100644 --- a/.github/workflows/setup-os.yml +++ b/.github/setup-os/action.yml @@ -1,14 +1,14 @@ -name: OS setup - -runs: - using: 'composite' - steps: - - name: Install coreutils - if: runner.os == 'macOS' - run: | - brew install coreutils - - name: Install virtual display - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install -y xvfb +name: OS setup + +runs: + using: 'composite' + steps: + - name: Install coreutils + if: runner.os == 'macOS' + run: | + brew install coreutils + - name: Install virtual display + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y xvfb diff --git a/.github/workflows/setup-python.yml b/.github/setup-python/action.yml similarity index 100% rename from .github/workflows/setup-python.yml rename to .github/setup-python/action.yml From fd9c954f0582cebe344f99da38dd8cc4e4f4dab0 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 12:16:38 +0100 Subject: [PATCH 72/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 12a1f66a..7c1da21a 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -89,7 +89,7 @@ jobs: subproject: ${{ fromJson(needs.find-subprojects.outputs.gradio) }} steps: - uses: actions/checkout@v4 - - uses: ./.github/setup-os + - uses: .github/setup-os - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v5 with: From 6be0731e134b38f1f6599f9dc75e07b750096104 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 12:16:57 +0100 Subject: [PATCH 73/86] Update action.yml --- .github/setup-os/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/setup-os/action.yml b/.github/setup-os/action.yml index 63a96b67..13a63c95 100644 --- a/.github/setup-os/action.yml +++ b/.github/setup-os/action.yml @@ -5,10 +5,12 @@ runs: steps: - name: Install coreutils if: runner.os == 'macOS' + shell: bash run: | brew install coreutils - name: Install virtual display if: runner.os == 'Linux' + shell: bash run: | sudo apt-get update sudo apt-get install -y xvfb From 81dfcc048daa0345092386865b6fa960ef94238d Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 12:19:04 +0100 Subject: [PATCH 74/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 7c1da21a..12a1f66a 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -89,7 +89,7 @@ jobs: subproject: ${{ fromJson(needs.find-subprojects.outputs.gradio) }} steps: - uses: actions/checkout@v4 - - uses: .github/setup-os + - uses: ./.github/setup-os - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v5 with: From d9413f56a27733897a563e1b2c9e1793efdb56a2 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 13:31:45 +0100 Subject: [PATCH 75/86] Update --- .../{ => reusable-steps}/setup-os/action.yml | 0 .../reusable-steps/setup-python/action.yml | 23 ++++++++++ .github/setup-python/action.yml | 0 .github/workflows/sanity-check.yml | 46 +++++-------------- 4 files changed, 35 insertions(+), 34 deletions(-) rename .github/{ => reusable-steps}/setup-os/action.yml (100%) create mode 100644 .github/reusable-steps/setup-python/action.yml delete mode 100644 .github/setup-python/action.yml diff --git a/.github/setup-os/action.yml b/.github/reusable-steps/setup-os/action.yml similarity index 100% rename from .github/setup-os/action.yml rename to .github/reusable-steps/setup-os/action.yml diff --git a/.github/reusable-steps/setup-python/action.yml b/.github/reusable-steps/setup-python/action.yml new file mode 100644 index 00000000..10e6d943 --- /dev/null +++ b/.github/reusable-steps/setup-python/action.yml @@ -0,0 +1,23 @@ +name: Python setup + +inputs: + project: + required: true + +runs: + using: 'composite' + steps: + - name: Download sample video file + shell: bash + run: | + cd ${{ inputs.project }} + curl -L -o sample_video.mp4 https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4 + - name: Install dependencies + shell: bash + run: | + python -m pip install --upgrade pip + pip install -r ${{ inputs.project }}/requirements.txt + - name: List dependencies + shell: bash + run: | + pip list diff --git a/.github/setup-python/action.yml b/.github/setup-python/action.yml deleted file mode 100644 index e69de29b..00000000 diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 12a1f66a..b98b2362 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -67,11 +67,9 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r ${{ matrix.subproject }}/requirements.txt - pip list + - uses: ./.github/reusable-steps/setup-python + with: + project: ${{ matrix.subproject }} - name: Execute Notebook run: | cd ${{ matrix.subproject }} @@ -89,16 +87,14 @@ jobs: subproject: ${{ fromJson(needs.find-subprojects.outputs.gradio) }} steps: - uses: actions/checkout@v4 - - uses: ./.github/setup-os + - uses: ./.github/reusable-steps/setup-os - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r ${{ matrix.subproject }}/requirements.txt - pip list + - uses: ./.github/reusable-steps/setup-python + with: + project: ${{ matrix.subproject }} - name: Run Gradio App run: | cd ${{ matrix.subproject }} @@ -117,24 +113,14 @@ jobs: subproject: ${{ fromJson(needs.find-subprojects.outputs.webcam) }} steps: - uses: actions/checkout@v4 + - uses: ./.github/reusable-steps/setup-os - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - - name: Install virtual display - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install -y xvfb - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip install -r ${{ matrix.subproject }}/requirements.txt - pip list - - name: Download sample video file - run: | - cd ${{ matrix.subproject }} - curl -L -o sample_video.mp4 https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4 + - uses: ./.github/reusable-steps/setup-python + with: + project: ${{ matrix.subproject }} - name: Run Webcam Demo shell: bash run: | @@ -157,15 +143,7 @@ jobs: subproject: ${{ fromJson(needs.find-subprojects.outputs.js) }} steps: - uses: actions/checkout@v4 - - name: Install virtual display - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install -y xvfb - - name: Install coreutils - if: runner.os == 'macOS' - run: | - brew install coreutils + - uses: ./.github/reusable-steps/setup-os - name: Install Node.js uses: actions/setup-node@v4 with: From d0d743c0c9dec7fd362379fb8e93a6c8bcfe4e9f Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 13:40:39 +0100 Subject: [PATCH 76/86] Update --- .github/reusable-steps/setup-python/action.yml | 6 ++++++ .github/workflows/sanity-check.yml | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/reusable-steps/setup-python/action.yml b/.github/reusable-steps/setup-python/action.yml index 10e6d943..db182900 100644 --- a/.github/reusable-steps/setup-python/action.yml +++ b/.github/reusable-steps/setup-python/action.yml @@ -1,6 +1,8 @@ name: Python setup inputs: + python: + required: true project: required: true @@ -12,6 +14,10 @@ runs: run: | cd ${{ inputs.project }} curl -L -o sample_video.mp4 https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4 + - name: Set up Python ${{ inputs.python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python }} - name: Install dependencies shell: bash run: | diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index b98b2362..3637e751 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -69,6 +69,7 @@ jobs: python-version: ${{ matrix.python }} - uses: ./.github/reusable-steps/setup-python with: + python: ${{ matrix.python }} project: ${{ matrix.subproject }} - name: Execute Notebook run: | @@ -94,6 +95,7 @@ jobs: python-version: ${{ matrix.python }} - uses: ./.github/reusable-steps/setup-python with: + python: ${{ matrix.python }} project: ${{ matrix.subproject }} - name: Run Gradio App run: | @@ -114,12 +116,9 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/reusable-steps/setup-os - - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python }} - uses: ./.github/reusable-steps/setup-python with: + python: ${{ matrix.python }} project: ${{ matrix.subproject }} - name: Run Webcam Demo shell: bash From c80e180d8bef0addb9bcf120fdca2a54a2dc547d Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 14:16:31 +0100 Subject: [PATCH 77/86] Update --- .github/workflows/sanity-check.yml | 51 ++++++++++++------------------ 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 3637e751..5f4450f4 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -71,10 +71,11 @@ jobs: with: python: ${{ matrix.python }} project: ${{ matrix.subproject }} - - name: Execute Notebook - run: | - cd ${{ matrix.subproject }} - jupyter nbconvert --to notebook --execute main.ipynb + - uses: ./.github/reusable-steps/timeouted-action + name: Run Notebook + with: + command: jupyter nbconvert --to notebook --execute main.ipynb + project: ${{ matrix.subproject }} gradio: needs: find-subprojects @@ -97,11 +98,11 @@ jobs: with: python: ${{ matrix.python }} project: ${{ matrix.subproject }} - - name: Run Gradio App - run: | - cd ${{ matrix.subproject }} - # the timeout trick "gracefully" kills the app after 5 minutes (waiting for user input otherwise) - timeout 5m python main.py || [[ $? -eq 124 ]] + - uses: ./.github/reusable-steps/timeouted-action + name: Run Gradio App + with: + command: python main.py + project: ${{ matrix.subproject }} webcam: needs: find-subprojects @@ -120,16 +121,11 @@ jobs: with: python: ${{ matrix.python }} project: ${{ matrix.subproject }} - - name: Run Webcam Demo - shell: bash - run: | - cd ${{ matrix.subproject }} - # linux requires a virtual display - if [ "${{ runner.os }}" == "Linux" ]; then - xvfb-run python main.py --stream sample_video.mp4 - else - python main.py --stream sample_video.mp4 - fi + - uses: ./.github/reusable-steps/timeouted-action + name: Run Webcam Demo + with: + command: python main.py --stream sample_video.mp4 + project: ${{ matrix.subproject }} js: needs: find-subprojects @@ -151,14 +147,9 @@ jobs: run: | cd ${{ matrix.subproject }} npm install - - name: Run JS Project - shell: bash - run: | - cd ${{ matrix.subproject }} - # linux requires a virtual display - if [ "${{ runner.os }}" == "Linux" ]; then - # the timeout trick "gracefully" kills the app after 1 minute (waiting for user input otherwise) - timeout 1m xvfb-run npm start || [[ $? -eq 124 ]] - else - timeout 1m npm start || [[ $? -eq 124 ]] - fi + - uses: ./.github/reusable-steps/timeouted-action + name: Run JS Project + with: + command: npm start + project: ${{ matrix.subproject }} + timeout: 1m From c684ad87fcd8a4fe42be61b45c84758a9476cff0 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 14:17:57 +0100 Subject: [PATCH 78/86] Update --- .github/workflows/sanity-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 5f4450f4..bae304b9 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -103,6 +103,7 @@ jobs: with: command: python main.py project: ${{ matrix.subproject }} + timeout: 5m webcam: needs: find-subprojects From 9bcf3a3a19acf6aade4f371a6edb3a62c3b4f24b Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 14:18:19 +0100 Subject: [PATCH 79/86] Update --- .../timeouted-action/action.yml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/reusable-steps/timeouted-action/action.yml diff --git a/.github/reusable-steps/timeouted-action/action.yml b/.github/reusable-steps/timeouted-action/action.yml new file mode 100644 index 00000000..bc256dde --- /dev/null +++ b/.github/reusable-steps/timeouted-action/action.yml @@ -0,0 +1,25 @@ +name: Run action with timeout + +inputs: + command: + required: true + project: + required: true + timeout: + required: false + default: 1h + +runs: + using: 'composite' + steps: + - name: Run JS Project + shell: bash + run: | + cd ${{ inputs.project }} + # linux requires a virtual display + if [ "${{ runner.os }}" == "Linux" ]; then + # the timeout trick "gracefully" kills the app after specified time (waiting for user input otherwise) + timeout ${{ inputs.timeout }} xvfb-run ${{ inputs.command }} || [[ $? -eq 124 ]] + else + timeout ${{ inputs.timeout }} ${{ inputs.command }} || [[ $? -eq 124 ]] + fi From b3c572f0168ffc9d76721d10e030d93201bfcfb5 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 15:20:19 +0100 Subject: [PATCH 80/86] Update action.yml --- .github/reusable-steps/setup-python/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/reusable-steps/setup-python/action.yml b/.github/reusable-steps/setup-python/action.yml index db182900..ea6035ff 100644 --- a/.github/reusable-steps/setup-python/action.yml +++ b/.github/reusable-steps/setup-python/action.yml @@ -27,3 +27,7 @@ runs: shell: bash run: | pip list + - name: Login to HF + shell: bash + run: | + huggingface-cli login --token ${{ secrets.HF_TOKEN }} From eea253634433887b0a5833f428348e1b9fa84a47 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 16:05:18 +0100 Subject: [PATCH 81/86] Update action.yml --- .github/reusable-steps/setup-python/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/reusable-steps/setup-python/action.yml b/.github/reusable-steps/setup-python/action.yml index ea6035ff..53297b59 100644 --- a/.github/reusable-steps/setup-python/action.yml +++ b/.github/reusable-steps/setup-python/action.yml @@ -29,5 +29,7 @@ runs: pip list - name: Login to HF shell: bash + env: + HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | - huggingface-cli login --token ${{ secrets.HF_TOKEN }} + huggingface-cli login --token $HF_TOKEN From a75f167d03882f840f0f2b8b8eb0151aec54dd01 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 16:14:42 +0100 Subject: [PATCH 82/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index bae304b9..94b0d0e0 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -68,6 +68,7 @@ jobs: with: python-version: ${{ matrix.python }} - uses: ./.github/reusable-steps/setup-python + secrets: inherit with: python: ${{ matrix.python }} project: ${{ matrix.subproject }} @@ -95,6 +96,7 @@ jobs: with: python-version: ${{ matrix.python }} - uses: ./.github/reusable-steps/setup-python + secrets: inherit with: python: ${{ matrix.python }} project: ${{ matrix.subproject }} @@ -119,6 +121,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/reusable-steps/setup-os - uses: ./.github/reusable-steps/setup-python + secrets: inherit with: python: ${{ matrix.python }} project: ${{ matrix.subproject }} From 76b364bce043c0ca82eebc7679643724c690320f Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 16:29:30 +0100 Subject: [PATCH 83/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 94b0d0e0..bae304b9 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -68,7 +68,6 @@ jobs: with: python-version: ${{ matrix.python }} - uses: ./.github/reusable-steps/setup-python - secrets: inherit with: python: ${{ matrix.python }} project: ${{ matrix.subproject }} @@ -96,7 +95,6 @@ jobs: with: python-version: ${{ matrix.python }} - uses: ./.github/reusable-steps/setup-python - secrets: inherit with: python: ${{ matrix.python }} project: ${{ matrix.subproject }} @@ -121,7 +119,6 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/reusable-steps/setup-os - uses: ./.github/reusable-steps/setup-python - secrets: inherit with: python: ${{ matrix.python }} project: ${{ matrix.subproject }} From 495cc0c08a6aaba0d76a4ad4eba56e5f0f595730 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 16:30:56 +0100 Subject: [PATCH 84/86] Update action.yml --- .github/reusable-steps/setup-python/action.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/reusable-steps/setup-python/action.yml b/.github/reusable-steps/setup-python/action.yml index 53297b59..db182900 100644 --- a/.github/reusable-steps/setup-python/action.yml +++ b/.github/reusable-steps/setup-python/action.yml @@ -27,9 +27,3 @@ runs: shell: bash run: | pip list - - name: Login to HF - shell: bash - env: - HF_TOKEN: ${{ secrets.HF_TOKEN }} - run: | - huggingface-cli login --token $HF_TOKEN From a381f00a753b56f92a5b118017bcf42dca8570ae Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 16:31:51 +0100 Subject: [PATCH 85/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index bae304b9..2b9f31f1 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -98,6 +98,10 @@ jobs: with: python: ${{ matrix.python }} project: ${{ matrix.subproject }} + - name: Login to HF + shell: bash + run: | + huggingface-cli login --token ${{ secrets.HF_TOKEN }} - uses: ./.github/reusable-steps/timeouted-action name: Run Gradio App with: From e84bcf08abf5b6e937cd457300cdf32afaef122d Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 27 Nov 2024 16:43:03 +0100 Subject: [PATCH 86/86] Update sanity-check.yml --- .github/workflows/sanity-check.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 2b9f31f1..d6ea84d8 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -1,10 +1,8 @@ name: Sanity check on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] + schedule: + - cron: "0 2 * * *" permissions: contents: read @@ -107,7 +105,7 @@ jobs: with: command: python main.py project: ${{ matrix.subproject }} - timeout: 5m + timeout: 30m webcam: needs: find-subprojects