From aa27443ae7fa78101573bc60e15db77934dff260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=B5=E5=B0=8F=E5=87=A1?= <2672931+whyb@users.noreply.github.com> Date: Mon, 8 Sep 2025 17:49:30 +0800 Subject: [PATCH 1/5] Add Ubuntu and MacOS GitHub CI(run-test.yml) --- .github/workflows/run-test.yml | 58 ++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index f5bb814..4321a78 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -1,4 +1,4 @@ -name: Windows CI for HwCodecDetect +name: Run CI on: push: @@ -15,7 +15,7 @@ jobs: shell: pwsh env: - PYTHONIOENCODING: utf-8 + PYTHONIOENCODING: utf-8 steps: - name: Clone HwCodecDetect @@ -32,3 +32,57 @@ jobs: - name: Run tests run: python -m src.HwCodecDetect.run_tests working-directory: HwCodecDetect + + test-on-ubuntu: + runs-on: ubuntu-latest + + env: + PYTHONIOENCODING: utf-8 + + steps: + - name: Install Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Clone HwCodecDetect + run: git clone -b main --single-branch https://github.com/whyb/HwCodecDetect.git + + - name: Upgrade pip + run: python -m pip install --upgrade pip + working-directory: HwCodecDetect + + - name: Install dependencies + run: python -m pip install -r requirements.txt + working-directory: HwCodecDetect + + - name: Run tests + run: python -m src.HwCodecDetect.run_tests + working-directory: HwCodecDetect + + test-on-macos: + runs-on: macos-latest + + env: + PYTHONIOENCODING: utf-8 + + steps: + - name: Install Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Clone HwCodecDetect + run: git clone -b main --single-branch https://github.com/whyb/HwCodecDetect.git + + - name: Upgrade pip + run: python -m pip install --upgrade pip + working-directory: HwCodecDetect + + - name: Install dependencies + run: python -m pip install -r requirements.txt + working-directory: HwCodecDetect + + - name: Run tests + run: python -m src.HwCodecDetect.run_tests + working-directory: HwCodecDetect From 3cfa746de09e517f7492e8b5687d7ead976d7dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=B5=E5=B0=8F=E5=87=A1?= <2672931+whyb@users.noreply.github.com> Date: Mon, 8 Sep 2025 17:55:52 +0800 Subject: [PATCH 2/5] Update ci (Install FFmpeg) --- .github/workflows/run-test.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index 4321a78..51ce6d1 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -48,6 +48,13 @@ jobs: - name: Clone HwCodecDetect run: git clone -b main --single-branch https://github.com/whyb/HwCodecDetect.git + - name: Install FFmpeg + run: | + sudo apt-get update + sudo apt-get install -y snapd + sudo snap install ffmpeg + ffmpeg -version + - name: Upgrade pip run: python -m pip install --upgrade pip working-directory: HwCodecDetect @@ -75,6 +82,12 @@ jobs: - name: Clone HwCodecDetect run: git clone -b main --single-branch https://github.com/whyb/HwCodecDetect.git + - name: Install FFmpeg + run: | + brew update + brew install ffmpeg + ffmpeg -version + - name: Upgrade pip run: python -m pip install --upgrade pip working-directory: HwCodecDetect From 0825598b7a3b19cb54b2fe865b641c158d9ea25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=B5=E5=B0=8F=E5=87=A1?= <2672931+whyb@users.noreply.github.com> Date: Mon, 8 Sep 2025 18:05:17 +0800 Subject: [PATCH 3/5] --encoder-count 8 --decoder-count 8 --- .github/workflows/run-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index 51ce6d1..6f50eb9 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -30,7 +30,7 @@ jobs: working-directory: HwCodecDetect - name: Run tests - run: python -m src.HwCodecDetect.run_tests + run: python -m src.HwCodecDetect.run_tests --encoder-count 8 --decoder-count 8 working-directory: HwCodecDetect test-on-ubuntu: @@ -64,7 +64,7 @@ jobs: working-directory: HwCodecDetect - name: Run tests - run: python -m src.HwCodecDetect.run_tests + run: python -m src.HwCodecDetect.run_tests --encoder-count 8 --decoder-count 8 working-directory: HwCodecDetect test-on-macos: @@ -97,5 +97,5 @@ jobs: working-directory: HwCodecDetect - name: Run tests - run: python -m src.HwCodecDetect.run_tests + run: python -m src.HwCodecDetect.run_tests --encoder-count 8 --decoder-count 8 working-directory: HwCodecDetect From 82db3041d9000908c7ed58a22dcc77d300cf2705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=B5=E5=B0=8F=E5=87=A1?= <2672931+whyb@users.noreply.github.com> Date: Mon, 8 Sep 2025 18:13:33 +0800 Subject: [PATCH 4/5] add-apt-repository in Ubuntu --- .github/workflows/run-test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index 6f50eb9..8cfa7dd 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -45,16 +45,16 @@ jobs: with: python-version: '3.10' - - name: Clone HwCodecDetect - run: git clone -b main --single-branch https://github.com/whyb/HwCodecDetect.git - - name: Install FFmpeg run: | + sudo add-apt-repository ppa:ubuntuhandbook1/ffmpeg sudo apt-get update - sudo apt-get install -y snapd - sudo snap install ffmpeg + sudo apt-get install ffmpeg ffmpeg -version + - name: Clone HwCodecDetect + run: git clone -b main --single-branch https://github.com/whyb/HwCodecDetect.git + - name: Upgrade pip run: python -m pip install --upgrade pip working-directory: HwCodecDetect @@ -79,15 +79,15 @@ jobs: with: python-version: '3.10' - - name: Clone HwCodecDetect - run: git clone -b main --single-branch https://github.com/whyb/HwCodecDetect.git - - name: Install FFmpeg run: | brew update brew install ffmpeg ffmpeg -version + - name: Clone HwCodecDetect + run: git clone -b main --single-branch https://github.com/whyb/HwCodecDetect.git + - name: Upgrade pip run: python -m pip install --upgrade pip working-directory: HwCodecDetect From 317e88db9c7d0d3d84f4a5617b1d6322eedb57ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=B5=E5=B0=8F=E5=87=A1?= <2672931+whyb@users.noreply.github.com> Date: Mon, 8 Sep 2025 18:16:16 +0800 Subject: [PATCH 5/5] download ffmpeg from johnvansickle --- .github/workflows/run-test.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index 8cfa7dd..3779541 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -45,12 +45,17 @@ jobs: with: python-version: '3.10' - - name: Install FFmpeg + - name: Install latest FFmpeg (static build) run: | - sudo add-apt-repository ppa:ubuntuhandbook1/ffmpeg + set -e sudo apt-get update - sudo apt-get install ffmpeg + sudo apt-get install -y xz-utils ca-certificates + curl -L -o ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz + tar -xJf ffmpeg.tar.xz + FF_DIR=$(find . -maxdepth 1 -type d -name "ffmpeg-*-amd64-static" | head -n1) + sudo mv "$FF_DIR/ffmpeg" "$FF_DIR/ffprobe" /usr/local/bin/ ffmpeg -version + ffprobe -version - name: Clone HwCodecDetect run: git clone -b main --single-branch https://github.com/whyb/HwCodecDetect.git