-
Notifications
You must be signed in to change notification settings - Fork 14
130 lines (110 loc) · 4.59 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: tests
on: [push, pull_request]
jobs:
test-docs:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Checkout repository
uses: actions/checkout@v2
- name: Install package from repository with docs dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[docs]
- name: List pip packages
run: |
pip -V
pip list
- name: Build docs
run: |
cd doc
make html
test-linux:
runs-on: ubuntu-20.04 # because Qt 6 requires glibc >= 2.28, which ubuntu-latest does not have
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9']
qt-version: [PyQt5, PySide2, PySide6]
# exclude:
# - qt-version: PySide2
# python-version: '3.9'
env:
DISPLAY: ':99.0'
XDG_RUNTIME_DIR: /tmp/runtime-runner
NEO_TEST_FILES: ~/ephy_testing_data_http
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-get install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
/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: Install OpenGL and EGL
# https://github.com/pyqtgraph/pyqtgraph/pull/1495#issuecomment-761397669
if: ${{ matrix.qt-version == 'PySide6' }}
run: |
sudo apt-get install -y libopengl0 libegl1-mesa
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Checkout repository
uses: actions/checkout@v2
- name: Install package from repository with test dependencies
run: |
python -m pip install --upgrade pip
pip install ${{ matrix.qt-version }}
pip install -e .[tests]
- name: Upgrade to latest pyqtgraph
if: ${{ matrix.pyqtgraph-dev }}
run: |
pip install -U git+https://github.com/pyqtgraph/pyqtgraph.git@master
- name: List pip packages
run: |
pip -V
pip list
- name: Check Qt bindings library
run: |
python -c "from ephyviewer import QT_MODE; assert QT_MODE == '${{ matrix.qt-version }}', 'Wrong Qt bindings: ' + QT_MODE"
- name: Restore cached Neo data files (if available)
# if the data files were recently downloaded during another job, they
# will be available in a cache. otherwise, this step prepares a cache
# to be created after the job completes.
uses: actions/cache@v2
with:
path: ${{ env.NEO_TEST_FILES }}
key: ${{ runner.os }}-${{ hashFiles('**/testing_tools.py') }}
- name: Download Neo data files (if cache could not be restored)
# these data files would be downloaded automatically when tests are
# run, but by downloading them ahead of time in a separate step we
# can monitor the progress in GitHub Actions. if the files already
# exist (because they were restored from the cache), no work is done.
# python -c "from ephyviewer.tests.testing_tools import get_tdt_test_files; get_tdt_test_files();"
run: |
python -c "from ephyviewer.tests.testing_tools import get_blackrock_files; get_blackrock_files();"
ls -lR ${{ env.NEO_TEST_FILES }}
- 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 }}-${{ matrix.qt-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 }}