-
Notifications
You must be signed in to change notification settings - Fork 13
91 lines (80 loc) · 2.97 KB
/
test_pull_request.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
# Reference: napari/napari github workflows
name: test PR
on:
pull_request:
branches:
- main
jobs:
test:
name: ${{ matrix.platform }} ${{ matrix.python }} ${{ matrix.toxenv || matrix.backend }}
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest]
python: ["3.9", "3.10"]
backend: [pyqt5]
include:
- python: 3.9
platform: windows-latest
backend: pyqt5
- python: 3.9
platform: macos-latest
backend: pyside2
- python: 3.9
platform: ubuntu-latest
backend: pyqt6
- python: 3.9
platform: ubuntu-latest
backend: pyside2
- python: 3.9 # only this run execute coverage
platform: ubuntu-latest
backend: pyside6
coverage: true
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
# see https://github.com/actions/runner-images/issues/709#issuecomment-612569242
- name: Workaround to free up space on github runner
if: runner.os == 'Linux'
run: sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'
- uses: tlambert03/setup-qt-libs@v1
# strategy borrowed from vispy for installing opengl libs on windows
- name: Install Windows OpenGL
if: runner.os == 'Windows'
run: |
git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
if (Test-Path -Path "C:\Windows\system32\opengl32.dll" -PathType Leaf) {Exit 0} else {Exit 1}
# tox and tox-gh-actions will take care of the "actual" installation
# of python dependendencies into a virtualenv. see tox.ini for more
- name: Install dependencies
run: |
pip install --upgrade pip
pip install setuptools tox tox-gh-actions
pip install ".[api]"
# here we pass off control of environment creation and running of tests to tox
# tox-gh-actions, installed above, helps to convert environment variables into
# tox "factors" ... limiting the scope of what gets tested on each platform
# for instance, on ubuntu-latest with python 3.8, it would be equivalent to this command:
# `tox -e py38-linux-pyqt,py38-linux-pyside`
# see tox.ini for more
- name: Test with tox
uses: GabrielBB/xvfb-action@v1
with:
run: python -m tox
env:
PLATFORM: ${{ matrix.platform }}
BACKEND: ${{ matrix.backend }}
TOXENV: ${{ matrix.toxenv }}
- name: Coverage
if: ${{ matrix.coverage }}
uses: codecov/codecov-action@v4