-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (56 loc) · 1.8 KB
/
python-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: "unittest for package"
on:
push:
branches: ["**"]
jobs:
ci:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install poetry
poetry install --with dev
# Install FFmpeg
- name: Install FFmpeg
run: |
sudo apt-get update -q
sudo apt-get install -y wget -q
wget https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-6.0-amd64-static.tar.xz -q
tar -xf ffmpeg-6.0-amd64-static.tar.xz
sudo mv ffmpeg-*-amd64-static/ffmpeg /usr/local/bin/
sudo mv ffmpeg-*-amd64-static/ffprobe /usr/local/bin/
ffmpeg -version
# Install webp
- run: sudo apt-get install -y webp
- name: Install GCC
run: sudo apt-get update && sudo apt-get install -y build-essential nasm
# Run linting
- name: Linting
run: poetry run pre-commit run --all-files
working-directory: src
# Run unittests
- name: Run Unittest
run: poetry run pytest src/ --cov=./src --cov-report xml
# Upload coverage to Codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
flags: ${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)
# Build Mkdocs
- name: Build Mkdocs
run: poetry run mkdocs build