-
Notifications
You must be signed in to change notification settings - Fork 655
52 lines (48 loc) · 2.26 KB
/
test_python.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
name: test_python
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
strategy:
matrix:
include:
# https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=python3
- { dist: 'ubuntu-20.04', python: '3.8.2' }
- { dist: 'ubuntu-22.04', python: '3.10.6' }
- { dist: 'ubuntu-24.04', python: '3.12.3' }
fail-fast: false
runs-on: ${{ matrix.dist }}
name: "Test on ${{ matrix.dist }}"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- run: sudo apt-mark hold grub-efi-amd64-signed # GRUB does not always find the drive it was configured for
- name: Ubuntu Noble workarounds
if: matrix.dist == 'ubuntu-24.04'
run: |
# https://github.com/actions/runner-images/pull/9956
sudo apt-get autopurge needrestart
# error: externally-managed-environment
echo -e '[global]\nbreak-system-packages=true' | sudo tee /etc/pip.conf
- run: sudo apt-get -q update
- run: sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq --no-install-recommends dist-upgrade
- run: sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq --no-install-recommends install
curl gcc ffmpeg libcurl4-openssl-dev libssl-dev motion v4l-utils
- run: python3 -m pip install --upgrade pip setuptools wheel
- run: python3 -m pip install --upgrade build mypy pytest
- run: python3 -m build
- run: python3 -m pip install .
- run: mkdir --parents --verbose .mypy_cache
- run: mypy --ignore-missing-imports --install-types --non-interactive --exclude build/ . || true
- run: pytest --ignore=tests/test_utils/test_mjpeg.py
--ignore=tests/test_utils/test_rtmp.py . || true
- run: pytest --fixtures tests/test_utils/test_mjpeg.py || true
- run: pytest --fixtures tests/test_utils/test_rtmp.py || true
- run: pytest . || pytest --doctest-modules . || true