-
Notifications
You must be signed in to change notification settings - Fork 24
368 lines (359 loc) · 9.97 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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
name: CI
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- "*"
release:
types:
- published
schedule:
# Daily at 05:47
- cron: '47 5 * * *'
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.sha || '' }}
cancel-in-progress: true
env:
PIP_NO_PYTHON_VERSION_WARNING: 1
permissions:
id-token: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
container: docker://python:3.11-buster
steps:
- uses: actions/checkout@v4
- name: Build
run: |
python -m venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install build
venv/bin/python -m build --outdir dist/
- uses: actions/upload-artifact@v4
if: always()
with:
name: dist
path: dist/*
if-no-files-found: error
test:
name: ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.reactor.name }} ${{ matrix.arch.name }}
needs: build
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
container: ${{ matrix.os.container[matrix.python.docker] }}
strategy:
fail-fast: false
matrix:
os:
- name: 🐧
matrix: linux
runs-on:
intel: ubuntu-latest
python_platform: linux
container:
"2.7": docker://python:2.7-buster
"3.6": docker://python:3.6-bullseye
"3.7": docker://python:3.7-bookworm
"3.8": docker://python:3.8-bookworm
"3.9": docker://python:3.9-bookworm
"3.10": docker://python:3.10-bookworm
"3.11": docker://python:3.11-bookworm
"3.12": docker://python:3.12-bookworm
"pypy2.7": docker://pypy:2.7-bookworm
"pypy3.7": docker://pypy:3.7-bullseye
"pypy3.8": docker://pypy:3.8-bookworm
"pypy3.9": docker://pypy:3.9-bookworm
"pypy3.10": docker://pypy:3.10-bookworm
- name: 🪟
matrix: windows
runs-on:
intel: windows-latest
python_platform: win32
- name: 🍎
matrix: macos
runs-on:
arm: macos-latest
intel: macos-13
python_platform: darwin
python:
- name: CPython 2.7
tox: py27
major-dot-minor: 2.7
action: 2.7
docker: 2.7
implementation: cpython
major: 2
- name: CPython 3.6
tox: py36
major-dot-minor: 3.6
action: 3.6
docker: 3.6
implementation: cpython
major: 3
- name: CPython 3.7
tox: py37
major-dot-minor: 3.7
action: 3.7
docker: 3.7
implementation: cpython
major: 3
- name: CPython 3.8
tox: py38
major-dot-minor: 3.8
action: 3.8
docker: 3.8
implementation: cpython
major: 3
- name: CPython 3.9
tox: py39
major-dot-minor: 3.9
action: 3.9
docker: 3.9
implementation: cpython
major: 3
- name: CPython 3.10
tox: py310
major-dot-minor: "3.10"
action: "3.10"
docker: "3.10"
implementation: cpython
major: 3
- name: CPython 3.11
tox: py311
major-dot-minor: "3.11"
action: "3.11"
docker: "3.11"
implementation: cpython
major: 3
- name: CPython 3.12
tox: py312
major-dot-minor: "3.12"
action: "3.12"
docker: "3.12"
implementation: cpython
major: 3
# disabled due to installation failures
# https://github.com/pytest-dev/pytest-twisted/pull/157
# - name: PyPy 2.7
# tox: pypy27
# action: pypy-2.7
# docker: pypy2.7
# implementation: pypy
# major: 2
- name: PyPy 3.7
tox: pypy37
major-dot-minor: 3.7
action: pypy-3.7
docker: pypy3.7
implementation: pypy
major: 3
- name: PyPy 3.8
tox: pypy38
major-dot-minor: 3.8
action: pypy-3.8
docker: pypy3.8
implementation: pypy
major: 3
- name: PyPy 3.9
tox: pypy39
major-dot-minor: 3.9
action: pypy-3.9
docker: pypy3.9
implementation: pypy
major: 3
- name: PyPy 3.10
tox: pypy310
major-dot-minor: "3.10"
action: pypy-3.10
docker: pypy3.10
implementation: pypy
major: 3
reactor:
- name: default
tox: default
dependencies: default
- name: PyQt5
tox: pyqt5
dependencies: qt5
- name: PySide2
tox: pyside2
dependencies: qt5
- name: asyncio
tox: asyncio
dependencies: asyncio
arch:
- name: ARM
matrix: arm
setup-python:
architecture: arm64
- name: Intel
matrix: intel
setup-python:
architecture: x64
exclude:
- python:
major: 2
os:
python_platform: darwin
- python:
major: 2
os:
python_platform: win32
- python:
major: 2
reactor:
tox: pyqt5
- python:
major: 2
reactor:
tox: pyside2
- python:
major-dot-minor: "3.11"
reactor:
tox: pyside2
- python:
major-dot-minor: "3.12"
reactor:
tox: pyside2
- python:
major: 2
reactor:
tox: asyncio
- python:
implementation: pypy
reactor:
tox: pyqt5
- python:
implementation: pypy
reactor:
tox: pyside2
- os:
matrix: linux
arch:
matrix: arm
- os:
matrix: windows
arch:
matrix: arm
- os:
matrix: macos
python:
major-dot-minor: "3.6"
arch:
matrix: arm
- os:
matrix: macos
python:
major-dot-minor: "3.7"
arch:
matrix: arm
- arch:
matrix: arm
reactor:
tox: pyside2
steps:
- uses: actions/checkout@v4
- name: Enable Problem Matchers
run: |
echo "::add-matcher::.github/local-problem-matchers.json"
- name: Set up ${{ matrix.python.name }}
if: ${{ job.container == '' }}
uses: actions/setup-python@v5
with:
# This allows the matrix to specify just the major.minor version while still
# expanding it to get the latest patch version including alpha releases.
# This avoids the need to update for each new alpha, beta, release candidate,
# and then finally an actual release version. actions/setup-python doesn't
# support this for PyPy presently so we get no help there.
#
# CPython -> 3.9.0-alpha - 3.9.X
# PyPy -> pypy-3.7
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python.action), matrix.python.action))[startsWith(matrix.python.action, 'pypy')] }}
architecture: ${{ matrix.arch.setup-python.architecture }}
- name: Report Python information
shell: bash
run: |
python -c 'import sys; print(sys.version)'
echo
echo " <=======>"
echo
pip --version
echo
echo " <=======>"
echo
pip list
echo
echo " <=======>"
echo
pip freeze --all
- name: Install Linux Qt5 dependencies
if: matrix.os.python_platform == 'linux' && matrix.reactor.dependencies == 'qt5'
run: |
apt-get update --yes
apt-get install --yes libgl1
- name: Install
run: |
pip install tox
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Test
shell: bash
run: |
tox --installpkg dist/*.whl -v -e "${{ matrix.python.tox }}-${{ matrix.reactor.tox }}reactor"
linting:
name: Linting
runs-on: ubuntu-latest
strategy:
matrix:
python:
- short: 311
dotted: "3.11"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python.dotted }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python.dotted }}
architecture: x64
- name: Install
run: |
pip install tox
- name: Test
run: |
tox -v -e linting
publish:
name: Publish
runs-on: ubuntu-latest
needs:
- build
- test
- linting
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release'
with:
packages-dir: dist/
skip-existing: true
all:
name: All
runs-on: ubuntu-latest
needs:
- build
- test
- linting
- publish
steps:
- name: This
shell: python
run: |
import this