-
Notifications
You must be signed in to change notification settings - Fork 7
176 lines (155 loc) · 4.89 KB
/
ci.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: CI
on:
push:
branches: [main]
tags: [v*]
pull_request:
workflow_dispatch:
schedule:
# run every week (for --pre release tests)
- cron: "0 0 * * 0"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-manifest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx run check-manifest
test:
name: ${{ matrix.os }} py${{ matrix.python-version }} ${{ matrix.gui }} ${{ matrix.canvas }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# using 3.12 as main current version, until 3.13 support
# is ubiquitous in upstream dependencies
python-version: ["3.10", "3.12"]
gui: [pyside, pyqt, jupyter, wxpython]
canvas: [vispy, pygfx]
exclude:
# unsolved intermittent segfaults on this combo
- python-version: "3.10"
gui: pyside
# wxpython does not build wheels for ubuntu or macos-latest py3.10
- os: ubuntu-latest
gui: wxpython
- os: macos-latest
gui: wxpython
python-version: "3.10"
include:
# test a couple more python variants, without
# full os/gui/canvas matrix coverage
- os: ubuntu-latest
python-version: "3.13"
gui: jupyter
canvas: vispy
- os: ubuntu-latest
python-version: "3.13"
gui: jupyter
canvas: pygfx
# pyside6 is struggling with 3.9
- os: ubuntu-latest
python-version: "3.9"
gui: pyqt
canvas: vispy
- os: macos-13
gui: wxpython
python-version: "3.9"
canvas: vispy
- os: windows-latest
gui: jupyter
python-version: "3.9"
canvas: pygfx
steps:
- uses: actions/checkout@v4
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: 📦 Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e '.[test,${{ matrix.gui }},${{ matrix.canvas }}]'
- uses: pyvista/setup-headless-display-action@v3
with:
qt: ${{ matrix.gui == 'pyside' || matrix.gui == 'pyqt' }}
- name: Install llvmpipe and lavapipe for offscreen canvas
if: matrix.os == 'ubuntu-latest' && matrix.canvas == 'pygfx'
run: |
sudo apt-get update -y -qq
sudo apt install -y libegl1-mesa-dev libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
- name: install pytest-qt
if: matrix.gui == 'pyside' || matrix.gui == 'pyqt'
run: pip install pytest-qt
- name: 🧪 Test
run: |
pytest --cov --cov-report=xml -v --color yes tests
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
test-array-libs:
uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@v2
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
extras: "test,vispy,third_party_arrays,pyqt"
coverage-upload: artifact
pip-post-installs: "pytest-qt"
qt: pyqt6
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.12"]
# make sure we can build docs without error
test-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "pip"
- name: 📦 Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e '.[docs]'
- name: 📚 Build docs
run: mkdocs build --strict
upload_coverage:
if: always()
needs: [test, test-array-libs]
uses: pyapp-kit/workflows/.github/workflows/upload-coverage.yml@v2
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
deploy:
name: Deploy
needs: test
if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'schedule'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: 👷 Build
run: |
python -m pip install build
python -m build
- name: 🚢 Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: "./dist/*"