From c4b3ae8757b3e986808908476d2376109ca989eb 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: Wed, 10 Sep 2025 22:30:05 +0800 Subject: [PATCH 1/5] Add archlinux github workflow --- .github/workflows/run-test.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index 3779541..de19f67 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -72,6 +72,36 @@ jobs: run: python -m src.HwCodecDetect.run_tests --encoder-count 8 --decoder-count 8 working-directory: HwCodecDetect + test-on-archlinux: + runs-on: ubuntu-latest + + env: + PYTHONIOENCODING: utf-8 + + container: + image: archlinux:latest + + steps: + - name: Update system and install dependencies + run: | + pacman -Syu --noconfirm + pacman -S --noconfirm python python-pip git ffmpeg + + - 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 --encoder-count 8 --decoder-count 8 + working-directory: HwCodecDetect + test-on-macos: runs-on: macos-latest From 35bc0ce71c00232f7baf221d70b389d1990dc243 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: Wed, 10 Sep 2025 22:35:20 +0800 Subject: [PATCH 2/5] use pipx install package in archlinux --- .github/workflows/run-test.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index de19f67..d5ac88c 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -75,31 +75,30 @@ jobs: test-on-archlinux: runs-on: ubuntu-latest - env: - PYTHONIOENCODING: utf-8 - container: image: archlinux:latest + env: + PYTHONIOENCODING: utf-8 + steps: - name: Update system and install dependencies run: | pacman -Syu --noconfirm - pacman -S --noconfirm python python-pip git ffmpeg + pacman -S --noconfirm python python-pip python-pipx git ffmpeg - 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 + - name: Install project with pipx + run: | + pipx ensurepath + pipx install . working-directory: HwCodecDetect - name: Run tests - run: python -m src.HwCodecDetect.run_tests --encoder-count 8 --decoder-count 8 + run: | + pipx run python -m src.HwCodecDetect.run_tests --encoder-count 8 --decoder-count 8 working-directory: HwCodecDetect test-on-macos: From 19fe6ec8bbbbfe08fea2298be80032926972e208 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: Thu, 11 Sep 2025 14:57:29 +0800 Subject: [PATCH 3/5] fix ci error(pipx run HwCodecDetect) --- .github/workflows/run-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index d5ac88c..7b1d764 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -98,7 +98,7 @@ jobs: - name: Run tests run: | - pipx run python -m src.HwCodecDetect.run_tests --encoder-count 8 --decoder-count 8 + pipx run HwCodecDetect --encoder-count 8 --decoder-count 8 working-directory: HwCodecDetect test-on-macos: From b03535e34f6124a6365011b23f50925109125e98 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: Thu, 11 Sep 2025 15:02:54 +0800 Subject: [PATCH 4/5] fix github ci error for archlinux --- .github/workflows/run-test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index 7b1d764..7d3b1a8 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -85,20 +85,20 @@ jobs: - name: Update system and install dependencies run: | pacman -Syu --noconfirm - pacman -S --noconfirm python python-pip python-pipx git ffmpeg + pacman -S --noconfirm python python-pip git ffmpeg - name: Clone HwCodecDetect run: git clone -b main --single-branch https://github.com/whyb/HwCodecDetect.git - - name: Install project with pipx + - name: Install project dependencies run: | - pipx ensurepath - pipx install . + pip install --upgrade pip + pip install -e . working-directory: HwCodecDetect - name: Run tests run: | - pipx run HwCodecDetect --encoder-count 8 --decoder-count 8 + python -m src.HwCodecDetect.run_tests --encoder-count 8 --decoder-count 8 working-directory: HwCodecDetect test-on-macos: From dc9ff6e5d037c7f356f8a82bab769f705f17b41c 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: Thu, 11 Sep 2025 15:28:47 +0800 Subject: [PATCH 5/5] change to virtualenv --- .github/workflows/run-test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index 7d3b1a8..4288f9c 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -90,14 +90,17 @@ jobs: - name: Clone HwCodecDetect run: git clone -b main --single-branch https://github.com/whyb/HwCodecDetect.git - - name: Install project dependencies + - name: Create virtualenv and install project run: | + python -m venv .venv + source .venv/bin/activate pip install --upgrade pip pip install -e . working-directory: HwCodecDetect - name: Run tests run: | + source .venv/bin/activate python -m src.HwCodecDetect.run_tests --encoder-count 8 --decoder-count 8 working-directory: HwCodecDetect