-
Notifications
You must be signed in to change notification settings - Fork 7
244 lines (215 loc) · 7.21 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
name: CI
on:
push:
branches: [main]
tags: [v*]
pull_request:
workflow_dispatch:
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 }}
env:
UV_PYTHON: ${{ matrix.python-version }}
UV_FROZEN: 1
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
# this one always segfaults
- python-version: "3.12"
os: ubuntu-latest
gui: pyside
canvas: vispy
- 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: ubuntu-latest
python-version: "3.11"
gui: pyqt
canvas: vispy
- os: ubuntu-latest
python-version: "3.13"
gui: pyqt
canvas: pygfx
- 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 uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
# https://github.com/pyvista/setup-headless-display-action/pull/26
- name: Configure curl to disable revocation checks and add retries
if: matrix.os == 'windows-latest'
run: |
echo --ssl-no-revoke > C:\Users\runneradmin\_curlrc
echo '--retry 5' >> C:\Users\runneradmin\_curlrc
type C:\Users\runneradmin\_curlrc
- 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: 🧪 Test (attempt 1)
id: test1
continue-on-error: true
shell: bash
run: make test extras="${{ matrix.gui }},${{ matrix.canvas }}" cov=1
- name: 🧪 Test (attempt 2)
if: steps.test1.outcome == 'failure'
id: test2
continue-on-error: true
shell: bash
run: make test extras="${{ matrix.gui }},${{ matrix.canvas }}" cov=1 verbose=1
- name: 🧪 Test (attempt 3)
if: steps.test2.outcome == 'failure'
shell: bash
run: make test extras="${{ matrix.gui }},${{ matrix.canvas }}" cov=1 verbose=1
- name: 🧪 Test min dependencies (attempt 1)
id: min1
continue-on-error: true
shell: bash
run: make test extras="${{ matrix.gui }},${{ matrix.canvas }}" min=1
- name: 🧪 Test min dependencies (attempt 2)
if: steps.min1.outcome == 'failure'
id: min2
continue-on-error: true
shell: bash
run: make test extras="${{ matrix.gui }},${{ matrix.canvas }}" min=1 verbose=1
- name: 🧪 Test min dependencies (attempt 3)
if: steps.min2.outcome == 'failure'
shell: bash
run: make test extras="${{ matrix.gui }},${{ matrix.canvas }}" min=1 verbose=1
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: covreport-${{ matrix.os }}-py${{ matrix.python-version }}-${{ matrix.gui }}-${{ matrix.canvas }}
path: ./.coverage*
include-hidden-files: true
test-array-libs:
runs-on: ubuntu-latest
env:
UV_PYTHON: ${{ matrix.python-version }}
UV_FROZEN: 1
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: pyvista/setup-headless-display-action@v3
with:
qt: true
- name: Install llvmpipe and lavapipe for offscreen canvas
run: sudo apt install -y libegl1-mesa-dev libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
- name: 🧪 Test (attempt 1)
id: test1
continue-on-error: true
run: make test extras="pyqt,pygfx" groups="array-libs" cov=1
- name: 🧪 Test (attempt 2)
if: steps.test1.outcome == 'failure'
id: test2
run: make test extras="pyqt,pygfx" groups="array-libs" cov=1 verbose=1
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: covreport-py${{ matrix.python-version }}-array-libs
path: ./.coverage*
include-hidden-files: true
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 }}
# make sure we can build docs without error
test-docs:
runs-on: macos-latest # nicer screenshots
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: 📚 Build docs
run: uv run --group docs mkdocs build --strict
- uses: actions/upload-artifact@v4
with:
name: docs
path: site
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/*"