-
Notifications
You must be signed in to change notification settings - Fork 4
214 lines (206 loc) · 6.49 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
name: CI
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- "**"
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
jobs:
Builds:
name: '${{ matrix.name }}'
timeout-minutes: 10
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
include:
- python: '3.10'
name: 'Build source'
pep517_option: '--source'
- python: '3.10'
name: 'Build binary'
pep517_option: '--binary'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: '${{ matrix.python }}'
- name: Build
run: |-
python -m venv venv
venv/bin/python -m pip install --quiet --upgrade pip setuptools wheel
venv/bin/python -m pip install --quiet --upgrade pep517 twine
venv/bin/python -m pip list
venv/bin/python -m pip freeze
venv/bin/python -m pep517.build ${{ matrix.pep517_option }} --out-dir dist/ .
venv/bin/python -m twine check --strict dist/*
- name: Publish
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/
Checks:
name: '${{ matrix.name }}'
timeout-minutes: 10
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
include:
- python: '3.9'
check_docs: '1'
name: 'Check docs'
qt_library: 'PySide2'
- python: '3.9'
check_formatting: '1'
name: 'Check formatting'
qt_library: 'PySide2'
- python: '3.9'
check_type_hints: '1'
name: 'Check type hints (PySide2)'
qt_library: 'PySide2'
- python: '3.10'
check_type_hints: '1'
name: 'Check type hints (PyQt5)'
qt_library: 'PyQt5'
- python: '3.9'
check_manifest: '1'
name: 'Check manifest'
qt_library: 'PySide2'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: '${{ matrix.python }}'
- name: Run tests
run: ./ci.sh
env:
CHECK_DOCS: '${{ matrix.check_docs }}'
CHECK_FORMATTING: '${{ matrix.check_formatting }}'
CHECK_TYPE_HINTS: '${{ matrix.check_type_hints }}'
CHECK_MANIFEST: '${{ matrix.check_manifest }}'
# Should match 'name:' up above
JOB_NAME: '${{ matrix.name }}'
# TODO: needs some Qt library but I'm not clear the implications of
# choosing one over the other
INSTALL_EXTRAS: '[${{ matrix.qt_library }},p_checks,p_docs]'
Windows:
name: 'Windows (${{ matrix.python }}, ${{ matrix.arch }}, ${{ matrix.qt_library }})'
timeout-minutes: 20
runs-on: 'windows-latest'
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
arch: ['x86', 'x64']
qt_library: ['PyQt5', 'PySide2']
exclude:
- python: '3.10'
qt_library: 'PySide2'
- python: '3.11'
qt_library: 'PySide2'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: '${{ matrix.python }}.0-alpha - ${{ matrix.python }}.X'
architecture: '${{ matrix.arch }}'
- name: Run tests
run: ./ci.sh
shell: bash
env:
# Should match 'name:' up above
JOB_NAME: 'Windows (${{ matrix.python }}, ${{ matrix.arch }}, ${{ matrix.qt_library }})'
INSTALL_EXTRAS: '[${{ matrix.qt_library }},p_tests]'
# TODO: https://github.com/pytest-dev/pytest/issues/7623
PYTHONIOENCODING: 'utf-8'
Linux:
name: 'Linux (${{ matrix.python }}, ${{ matrix.qt_library }})'
timeout-minutes: 10
runs-on: 'ubuntu-latest'
container: 'docker://python:${{ matrix.python }}-buster'
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
qt_library: ['PyQt5', 'PySide2']
exclude:
- python: '3.10'
qt_library: 'PySide2'
- python: '3.11'
qt_library: 'PySide2'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Qt5 dependencies
run: |
apt-get update --yes
apt-get install --yes libgl1
- name: Install Linux test dependencies
run: |
apt-get update --yes
apt-get install --yes libgl1-mesa-dev xvfb x11-utils libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
- uses: altendky/QTBUG-88688-libxcb-util@v2
- name: Run tests
run: ./ci.sh
env:
# Should match 'name:' up above
JOB_NAME: 'Linux (${{ matrix.python }}, ${{ matrix.qt_library }})'
INSTALL_EXTRAS: '[${{ matrix.qt_library }},p_tests]'
macOS:
name: 'macOS (${{ matrix.python }}, ${{matrix.qt_library}})'
timeout-minutes: 10
runs-on: 'macos-latest'
strategy:
fail-fast: false
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
qt_library: ['PyQt5', 'PySide2']
exclude:
- python: '3.10'
qt_library: 'PySide2'
- python: '3.11'
qt_library: 'PySide2'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: '${{ matrix.python }}.0-alpha - ${{ matrix.python }}.X'
- name: Run tests
run: ./ci.sh
env:
# Should match 'name:' up above
JOB_NAME: 'macOS (${{ matrix.python }}, ${{matrix.qt_library}})'
INSTALL_EXTRAS: '[${{ matrix.qt_library }},p_tests]'
all:
name: All
runs-on: ubuntu-latest
if: always()
needs:
- Builds
- Checks
- Windows
- Linux
- macOS
steps:
- name: Require all successes
uses: re-actors/[email protected]
with:
jobs: ${{ toJSON(needs) }}