-
Notifications
You must be signed in to change notification settings - Fork 4
257 lines (212 loc) · 6.75 KB
/
workflow.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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python CI
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
jobs:
build-pure-wheel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install pypa build
run: python -m pip install build
- name: Create wheel
run: python -m build -w .
env:
PYAVB_BUILD_EXT: '0'
- name: Upload wheel
uses: actions/upload-artifact@v3
with:
name: pure-wheel
path: dist/*.whl
build-cython-wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["cp27*", "cp37*", "cp38*", "cp39*", "cp310*"]
steps:
- uses: actions/checkout@v3
- name: Prepare compiler environment for Windows (Python 2.7)
if: matrix.python-version == 'cp27*' && runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
# cibuildwheel 1.12.0 gates Python 2.7 wheels builds
# by using two environment variables, DISTUTILS_USE_SDK and MSSdk.
# https://cibuildwheel.readthedocs.io/en/1.x/cpp_standards/#windows-and-python-27
- name: Set Windows Python 2.7 environment variables
if: matrix.python-version == 'cp27*' && runner.os == 'Windows'
shell: bash
run: |
echo "DISTUTILS_USE_SDK=1" >> $GITHUB_ENV
echo "MSSdk=1" >> $GITHUB_ENV
- name: Build wheels (Python 2.7)
if: matrix.python-version == 'cp27*'
# cibuildwheel 1.12.0 is the last release that supported Python 2.7.
uses: pypa/[email protected]
with:
output-dir: wheelhouse
env:
CIBW_BUILD: ${{ matrix.python-version }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010
CIBW_MANYLINUX_I686_IMAGE: manylinux2010
CIBW_ARCHS_WINDOWS: AMD64 # On windows we will only compile 64 bits wheels.
CIBW_BUILD_VERBOSITY: 1
- name: Build wheels (Python 3)
uses: pypa/[email protected]
if: matrix.python-version != 'cp27*'
with:
output-dir: wheelhouse
env:
CIBW_BUILD: ${{ matrix.python-version }}
CIBW_SKIP: '*musllinux*'
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010
CIBW_MANYLINUX_I686_IMAGE: manylinux2010
CIBW_BUILD_VERBOSITY: 1
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: cython-wheels
path: ./wheelhouse/*.whl
test-pure-wheel:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
needs:
- build-pure-wheel
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Download pure wheel
uses: actions/download-artifact@v3
with:
name: pure-wheel
path: dist/
- name: Run Unit Tests
shell: bash
run: |
python -m pip install dist/* --no-index
python -m unittest discover tests -v
test-cython-wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
needs:
- build-cython-wheels
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Download cython wheels
uses: actions/download-artifact@v3
with:
name: cython-wheels
path: dist/
- name: Run Unit Tests
shell: bash
run: |
python -m pip install --find-links=./dist --no-index --only-binary=:all: pyavb
python -m unittest discover tests -v
test-cython-wheels-27:
runs-on: ubuntu-latest
container: coatldev/six:latest
needs:
- build-cython-wheels
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Download cython wheels
uses: actions/download-artifact@v3
with:
name: cython-wheels
path: dist/
- name: Run Unit Tests
shell: bash
run: |
python2 --version
python2 -m pip install --find-links=./dist --no-index --only-binary=:all: pyavb
python2 -m unittest discover tests -v
test-pure-wheels-27:
runs-on: ubuntu-latest
container: coatldev/six:latest
needs:
- build-pure-wheel
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Download cython wheels
uses: actions/download-artifact@v3
with:
name: pure-wheel
path: dist/
- name: Run Unit Tests
shell: bash
run: |
python2 --version
python2 -m pip install --find-links=./dist --no-index --only-binary=:all: pyavb
python2 -m unittest discover tests -v
latest-release:
needs:
- test-cython-wheels
- test-cython-wheels-27
- test-pure-wheel
- test-pure-wheels-27
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Create sdist
run: |
pip install build
python -m build -s .
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: sdist
path: ./dist/*.tar.gz
- name: Download pure wheel
uses: actions/download-artifact@v3
with:
name: pure-wheel
path: dist
- name: Download cython wheels
uses: actions/download-artifact@v3
with:
name: cython-wheels
path: dist
- name: Display structure of downloaded files
run: ls -R
working-directory: dist/
- uses: "marvinpinto/action-automatic-releases@latest"
if: ${{ github.ref == 'refs/heads/main' }}
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: |
dist/*.tar.gz
dist/*.whl