Skip to main content

.github/workflows/test.yml

1name: Test
3on:
4 push:
5 branches:
6 - main
8 pull_request:
9 branches:
10 - main
12jobs:
13 test:
14 runs-on: macos-latest
15 strategy:
16 matrix:
17 python-version: ["3.13", "3.14"]
19 steps:
20 - uses: actions/checkout@v6
22 - name: Set up Python
23 uses: actions/setup-python@v6
24 with:
25 python-version: ${{ matrix.python-version }}
26 cache: pip
28 - name: Install Python dependencies
29 run: pip install -r dev_requirements.txt
31 - name: Install create_thumbnail
32 env:
33 GH_TOKEN: ${{ github.token }}
34 run: |
35 gh release download \
36 --repo alexwlchan/create_thumbnail \
37 --pattern create_thumbnail-aarch64-apple-darwin.tar.gz \
38 --output create_thumbnail.tar.gz
39 tar -xzf create_thumbnail.tar.gz --directory /usr/local/bin
40 chmod +x /usr/local/bin/create_thumbnail
41 which create_thumbnail
43 - name: Install dominant_colours
44 env:
45 GH_TOKEN: ${{ github.token }}
46 run: |
47 gh release download \
48 --repo alexwlchan/dominant_colours \
49 --pattern dominant_colours-aarch64-apple-darwin.tar.gz \
50 --output dominant_colours.tar.gz
51 tar -xzf dominant_colours.tar.gz --directory /usr/local/bin
52 chmod +x /usr/local/bin/dominant_colours
53 which dominant_colours
55 - name: Install get_live_text
56 env:
57 GH_TOKEN: ${{ github.token }}
58 run: |
59 gh release download \
60 --repo alexwlchan/get_live_text \
61 --pattern get_live_text.aarch64-apple-darwin.zip \
62 --output get_live_text.tar.gz
63 tar -xzf get_live_text.tar.gz --directory /usr/local/bin
64 chmod +x /usr/local/bin/get_live_text
65 which get_live_text
67 - name: Install ffprobe
68 run: |
69 curl --location -O https://evermeet.cx/ffmpeg/ffprobe-8.0.1.7z
70 tar -xzf ffprobe-8.0.1.7z --directory /usr/local/bin
71 chmod +x /usr/local/bin/ffprobe
72 which ffprobe
74 - name: Install WebKit
75 run: playwright install webkit
77 - name: Check formatting
78 run: |
79 ruff check .
80 ruff format --check .
82 - name: Check types
83 run: mypy src tests
85 - name: Run tests
86 run: |
87 coverage run -m pytest tests
88 coverage report