Skip to content

Commit 8e14e11

Browse files
authored
Merge pull request #2 from whyb/testci
Test CI(Add Ubuntu and MacOS)
2 parents 7e9e196 + 317e88d commit 8e14e11

1 file changed

Lines changed: 75 additions & 3 deletions

File tree

.github/workflows/run-test.yml

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Windows CI for HwCodecDetect
1+
name: Run CI
22

33
on:
44
push:
@@ -15,7 +15,7 @@ jobs:
1515
shell: pwsh
1616

1717
env:
18-
PYTHONIOENCODING: utf-8
18+
PYTHONIOENCODING: utf-8
1919

2020
steps:
2121
- name: Clone HwCodecDetect
@@ -30,5 +30,77 @@ jobs:
3030
working-directory: HwCodecDetect
3131

3232
- name: Run tests
33-
run: python -m src.HwCodecDetect.run_tests
33+
run: python -m src.HwCodecDetect.run_tests --encoder-count 8 --decoder-count 8
34+
working-directory: HwCodecDetect
35+
36+
test-on-ubuntu:
37+
runs-on: ubuntu-latest
38+
39+
env:
40+
PYTHONIOENCODING: utf-8
41+
42+
steps:
43+
- name: Install Python 3.10
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: '3.10'
47+
48+
- name: Install latest FFmpeg (static build)
49+
run: |
50+
set -e
51+
sudo apt-get update
52+
sudo apt-get install -y xz-utils ca-certificates
53+
curl -L -o ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
54+
tar -xJf ffmpeg.tar.xz
55+
FF_DIR=$(find . -maxdepth 1 -type d -name "ffmpeg-*-amd64-static" | head -n1)
56+
sudo mv "$FF_DIR/ffmpeg" "$FF_DIR/ffprobe" /usr/local/bin/
57+
ffmpeg -version
58+
ffprobe -version
59+
60+
- name: Clone HwCodecDetect
61+
run: git clone -b main --single-branch https://github.com/whyb/HwCodecDetect.git
62+
63+
- name: Upgrade pip
64+
run: python -m pip install --upgrade pip
65+
working-directory: HwCodecDetect
66+
67+
- name: Install dependencies
68+
run: python -m pip install -r requirements.txt
69+
working-directory: HwCodecDetect
70+
71+
- name: Run tests
72+
run: python -m src.HwCodecDetect.run_tests --encoder-count 8 --decoder-count 8
73+
working-directory: HwCodecDetect
74+
75+
test-on-macos:
76+
runs-on: macos-latest
77+
78+
env:
79+
PYTHONIOENCODING: utf-8
80+
81+
steps:
82+
- name: Install Python 3.10
83+
uses: actions/setup-python@v5
84+
with:
85+
python-version: '3.10'
86+
87+
- name: Install FFmpeg
88+
run: |
89+
brew update
90+
brew install ffmpeg
91+
ffmpeg -version
92+
93+
- name: Clone HwCodecDetect
94+
run: git clone -b main --single-branch https://github.com/whyb/HwCodecDetect.git
95+
96+
- name: Upgrade pip
97+
run: python -m pip install --upgrade pip
98+
working-directory: HwCodecDetect
99+
100+
- name: Install dependencies
101+
run: python -m pip install -r requirements.txt
102+
working-directory: HwCodecDetect
103+
104+
- name: Run tests
105+
run: python -m src.HwCodecDetect.run_tests --encoder-count 8 --decoder-count 8
34106
working-directory: HwCodecDetect

0 commit comments

Comments
 (0)