-
Notifications
You must be signed in to change notification settings - Fork 9
105 lines (87 loc) · 3.09 KB
/
tests.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: tests
on: [push, pull_request]
jobs:
test-docs:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Checkout repository
uses: actions/checkout@v3
- name: Install package from repository with docs dependencies
run: |
pip install -e .[docs]
- name: List pip packages
run: |
pip -V
pip list
- name: Build docs
run: |
cd docs
make html
test-linux:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10'] #, '3.11']
env:
DISPLAY: ':99.0'
steps:
- name: Set up virtual framebuffer (xvfb) for Qt GUI testing
# https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions
run: |
sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX
- name: Set up Python ${{ matrix.python-version }}
run: |
echo $CONDA/bin >> $GITHUB_PATH # prioritize conda over system python
conda config --add channels conda-forge
conda install -y -q python=${{ matrix.python-version }}
# conda create -y -q -n test-environment python=${{ matrix.python-version }}
# source activate test-environment
- name: Checkout repository
uses: actions/checkout@v3
- name: Install package from repository with tests dependencies
run: |
pip install -e .[tests]
- name: Install PyAV
run: |
conda install -y -q av
- name: Verify Python version
run: |
which python
python --version
python -c "import os, sys; assert sys.version_info[:2] == tuple(map(int, '${{ matrix.python-version }}'.split('.')))[:2]"
- name: List pip packages
run: |
pip -V
pip list
- name: List conda packages
run: |
conda env list
conda list
- name: Run tests
run: |
pytest -v --cov
- name: Report coverage to Coveralls
run: coveralls
env:
COVERALLS_SERVICE_NAME: github
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: test-linux-${{ matrix.python-version }}
COVERALLS_PARALLEL: true
coveralls:
name: Finish Coveralls
needs: test-linux
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finish Coveralls
run: |
pip3 install --upgrade coveralls
coveralls --finish
env:
COVERALLS_SERVICE_NAME: github
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}