-
Notifications
You must be signed in to change notification settings - Fork 5
427 lines (407 loc) · 17.1 KB
/
lint-test-cover-docs-build-upload.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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
name: lint-test-cover-docs-build-upload
on:
push
jobs:
manylinux:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- {version: '3.7', abi: 'cp37'}
- {version: '3.8', abi: 'cp38'}
- {version: '3.9', abi: 'cp39'}
- {version: '3.10', abi: 'cp310'}
- {version: '3.11', abi: 'cp311'}
name: Python ${{ matrix.python.version }} with ABI ${{ matrix.python.abi }} for manylinux2014_x86_64
env:
WHEELNAME: rbcl-${{ github.ref_name }}-${{ matrix.python.abi }}-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64
steps:
- uses: actions/checkout@v4
- name: Install Python.
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python.version }}
architecture: x64
- name: Download libsodium source tree archive.
run: |
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
mv libsodium-1.0.18.tar.gz src/rbcl/libsodium.tar.gz
- name: Install Python dependencies for build process.
run: |
pip install .[build]
- name: Build wheel file.
run: |
mkdir tmpwheelhouse
LIBSODIUM_MAKE_ARGS="-j$(nproc)" python -m build --wheel
mv dist/rbcl*.whl tmpwheelhouse
mkdir wheelhouse
mv tmpwheelhouse/rbcl*.whl wheelhouse/
cp build/lib*/rbcl/_sodium.py src/rbcl/_sodium.py
- name: Test wheel installation.
run: |
pip install -f wheelhouse --no-index --force-reinstall --no-dependencies rbcl
- name: Lint and test module (and compiled libsodium shared library file).
run: |
pip install -U .[lint,test]
python -m pylint rbcl src/rbcl/_sodium.tmpl src/rbcl/_sodium_build.py --disable=duplicate-code # Check against linting rules.
python src/rbcl/rbcl.py -v # Run doctests.
python -m pytest # Run tests.
- name: Publish coverage results.
run: |
pip install -U .[coveralls]
python -m coveralls --service=github # Submit to coveralls.
if: matrix.python.version == '3.11'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
- name: Test auto-generation of documentation.
run: |
pip install -U .[docs]
cd docs
sphinx-apidoc -f -E --templatedir=_templates -o _source .. ../src/rbcl/_sodium_build.py
make html
cd ..
- name: Upload wheel file.
run: |
mkdir rbcl-wheelhouse
mv wheelhouse/rbcl*.whl rbcl-wheelhouse/${{ env.WHEELNAME }}.whl
- uses: actions/upload-artifact@v3
with:
name: ${{ env.WHEELNAME }}
path: rbcl-wheelhouse/
macos:
runs-on: macos-latest
strategy:
matrix:
python:
- {version: '3.7', abi: 'cp37', url: '3.7.9'}
- {version: '3.8', abi: 'cp38', url: '3.8.9'}
- {version: '3.9', abi: 'cp39', url: '3.9.9'}
name: Python ${{ matrix.python.version }} with ABI ${{ matrix.python.abi }} for macOS 10.9
env:
WHEELNAME: rbcl-${{ github.ref_name }}-${{ matrix.python.abi }}-abi3-macosx_10_9_x86_64
steps:
- uses: actions/checkout@v4
- name: Install Python.
run: |
curl "https://www.python.org/ftp/python/${{ matrix.python.url }}/python-${{ matrix.python.url }}-macosx10.9.pkg" -o python.pkg
sudo installer -pkg python.pkg -target /
/Library/Frameworks/Python.framework/Versions/${{ matrix.python.version }}/bin/python3 -m pip install -U virtualenv
/Library/Frameworks/Python.framework/Versions/${{ matrix.python.version }}/bin/python3 -m virtualenv venv
- name: Download libsodium source tree archive.
run: |
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
mv libsodium-1.0.18.tar.gz src/rbcl/libsodium.tar.gz
- name: Install Python dependencies for build process.
run: |
venv/bin/pip install -U pip .[build]
- name: Build wheel file.
run: |
mkdir wheelhouse
rm -f dist/*.*
LIBSODIUM_MAKE_ARGS="-j$(sysctl -n hw.ncpu)" CFLAGS="-mmacosx-version-min=10.9 -march=core2" \
venv/bin/python -m build --wheel && mv dist/rbcl*.whl wheelhouse
cp build/lib*/rbcl/_sodium.py src/rbcl/_sodium.py
- name: Test wheel installation.
run: |
venv/bin/pip install -f wheelhouse --no-index --force-reinstall --no-dependencies rbcl
- name: Lint and test module (and compiled libsodium shared library file).
run: |
venv/bin/pip install -U pip .[lint,test]
venv/bin/python -m pylint rbcl src/rbcl/_sodium.tmpl src/rbcl/_sodium_build.py --disable=duplicate-code # Check against linting rules.
venv/bin/python src/rbcl/rbcl.py -v # Run doctests.
venv/bin/python -m pytest # Run tests.
- name: Test auto-generation of documentation.
run: |
venv/bin/pip install -U .[docs]
cd docs
../venv/bin/sphinx-apidoc -f -E --templatedir=_templates -o _source .. ../src/rbcl/_sodium_build.py
make html SPHINXBUILD='../venv/bin/sphinx-build'
cd ..
- name: Upload wheel file.
run: |
mkdir rbcl-wheelhouse
mv wheelhouse/rbcl*.whl rbcl-wheelhouse/${{ env.WHEELNAME }}.whl
- uses: actions/upload-artifact@v3
with:
name: ${{ env.WHEELNAME }}
path: rbcl-wheelhouse/
macos-arm:
runs-on: [self-hosted, macos, ARM64]
strategy:
matrix:
python:
- {version: '3.9', abi: 'cp39', url: '3.9.9'}
- {version: '3.10', abi: 'cp310', url: '3.10.6'}
- {version: '3.11', abi: 'cp311', url: '3.11.3'}
name: Python ${{ matrix.python.version }} with ABI ${{ matrix.python.abi }} for macOS 11 ARM
env:
WHEELNAME: rbcl-${{ github.ref_name }}-${{ matrix.python.abi }}-abi3-macosx_10_10_universal2
steps:
- uses: actions/checkout@v4
- name: Install Python.
run: |
curl "https://www.python.org/ftp/python/${{ matrix.python.url }}/python-${{ matrix.python.url }}-macos11.pkg" -o python.pkg
sudo installer -pkg python.pkg -target /
/Library/Frameworks/Python.framework/Versions/${{ matrix.python.version }}/bin/python3 -m pip install -U virtualenv
/Library/Frameworks/Python.framework/Versions/${{ matrix.python.version }}/bin/python3 -m virtualenv venv
- name: Download libsodium source tree archive.
run: |
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
mv libsodium-1.0.18.tar.gz src/rbcl/libsodium.tar.gz
- name: Install Python dependencies for build process.
run: |
venv/bin/pip install -U pip .[build]
- name: Build wheel file.
run: |
mkdir wheelhouse
rm -f dist/*.*
LIBSODIUM_MAKE_ARGS="-j$(sysctl -n hw.ncpu)" MACOSX_DEPLOYMENT_TARGET="10.10" CFLAGS="-arch arm64" ARCHFLAGS="-arch arm64" _PYTHON_HOST_PLATFORM="macosx-10.9-universal2" \
venv/bin/python -m build --wheel && mv dist/rbcl*.whl wheelhouse
cp build/lib*/rbcl/_sodium.py src/rbcl/_sodium.py
- name: Test wheel installation.
run: |
venv/bin/pip install -f wheelhouse --no-index --force-reinstall --no-dependencies rbcl
- name: Lint and test module (and compiled libsodium shared library file).
run: |
venv/bin/pip install -U pip .[lint,test]
venv/bin/python -m pylint rbcl src/rbcl/_sodium.tmpl src/rbcl/_sodium_build.py --disable=duplicate-code # Check against linting rules.
venv/bin/python src/rbcl/rbcl.py -v # Run doctests.
venv/bin/python -m pytest # Run tests.
- name: Test auto-generation of documentation.
run: |
venv/bin/pip install -U .[docs]
cd docs
../venv/bin/sphinx-apidoc -f -E --templatedir=_templates -o _source .. ../src/rbcl/_sodium_build.py
make html SPHINXBUILD='../venv/bin/sphinx-build'
cd ..
- name: Upload wheel file.
run: |
mkdir rbcl-wheelhouse
mv wheelhouse/rbcl*.whl rbcl-wheelhouse/${{ env.WHEELNAME }}.whl
- uses: actions/upload-artifact@v3
with:
name: ${{ env.WHEELNAME }}
path: rbcl-wheelhouse/
windows:
runs-on: windows-latest
strategy:
matrix:
windows:
- {version: 'win32', arch: 'x86', arch-sodium: 'Win32', arch-vs: 'x86'}
- {version: 'win_amd64', arch: 'x64', arch-sodium: 'x64', arch-vs: 'amd64'}
python:
- {version: '3.7', abi: 'cp37'}
- {version: '3.8', abi: 'cp38'}
- {version: '3.9', abi: 'cp39'}
- {version: '3.10', abi: 'cp310'}
- {version: '3.11', abi: 'cp311'}
name: Python ${{ matrix.python.version }} with ABI ${{ matrix.python.abi }} for Windows ${{ matrix.windows.arch }}
env:
WHEELNAME: rbcl-${{ github.ref_name }}-${{ matrix.python.abi }}-abi3-${{ matrix.windows.version }}
INCLUDE: C:\libsodium\include
LIB: C:\libsodium\${{ matrix.windows.arch-sodium }}\Release\v142\dynamic\
steps:
- uses: actions/checkout@v4
- name: Install Python.
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python.version }}
architecture: ${{ matrix.windows.arch }}
- name: Download and extract libsodium dynamic library file.
run: |
wget -O C:\libsodium-1.0.18-msvc.zip https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-msvc.zip
Expand-Archive C:\libsodium-1.0.18-msvc.zip -DestinationPath C:\
shell: powershell
- name: Install Python dependencies for build process.
run: |
pip install -U pip .[build]
shell: bash
- name: Build wheel file.
run: |
mkdir wheelhouse
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -no_logo -arch=${{ matrix.windows.arch-vs }}
python -m build --wheel
mv dist/rbcl*.whl wheelhouse
cp build/lib*/rbcl/_sodium.py src/rbcl/_sodium.py
shell: cmd
- name: Test wheel installation.
run: |
pip install -f wheelhouse rbcl --no-index --force-reinstall --no-dependencies
shell: bash
- name: Lint and test module (and compiled libsodium shared library file).
run: |
pip install -U pip .[lint,test]
python -m pylint rbcl src/rbcl/_sodium.tmpl src/rbcl/_sodium_build.py --disable=duplicate-code # Check against linting rules.
python src/rbcl/rbcl.py -v # Run doctests.
python -m pytest # Run tests.
shell: bash
- name: Test auto-generation of documentation.
run: |
pip install -U .[docs]
cd docs
sphinx-apidoc -f -E --templatedir=_templates -o _source .. ../src/rbcl/_sodium_build.py
make html
cd ..
shell: bash
- name: Upload wheel file.
run: |
mkdir rbcl-wheelhouse
move wheelhouse\rbcl*.whl rbcl-wheelhouse\${{ env.WHEELNAME }}.whl
shell: cmd
- uses: actions/upload-artifact@v3
with:
name: ${{ env.WHEELNAME }}
path: rbcl-wheelhouse\
manylinux2014_aarch64:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- { version: '3.8', abi: 'cp38' }
- { version: '3.9', abi: 'cp39' }
- { version: '3.10', abi: 'cp310' }
- { version: '3.11', abi: 'cp311' }
- { version: '3.12', abi: 'cp312' }
name: Python ${{ matrix.python.version }} with ABI ${{ matrix.python.abi }} for manylinux2014_aarch64
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS_LINUX: "aarch64"
CIBW_BUILD: "${{ matrix.python.abi }}-manylinux_aarch64"
CIBW_PROJECT_REQUIRES_PYTHON: ">=${{ matrix.python.version }}"
CIBW_ENVIRONMENT: LIBSODIUM_MAKE_ARGS="-j$(nproc)"
CIBW_BEFORE_ALL: >
pip install .[build] -v
CIBW_REPAIR_WHEEL_COMMAND: ""
CIBW_TEST_EXTRAS: "lint,test,docs"
CIBW_BEFORE_TEST: >
cd {project} &&
cp build/lib*/rbcl/_sodium.py src/rbcl/_sodium.py &&
pip3 install pystache~=0.6 setuptools &&
yum install wget -y &&
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz &&
mv libsodium-1.0.18.tar.gz src/rbcl/libsodium.tar.gz
CIBW_TEST_COMMAND: >
cd {project} &&
python -m pylint rbcl src/rbcl/_sodium.tmpl src/rbcl/_sodium_build.py --disable=duplicate-code &&
python src/rbcl/rbcl.py -v &&
python -m pytest &&
cd docs &&
sphinx-apidoc -f -E --templatedir=_templates -o _source .. ../src/rbcl/_sodium_build.py ** &&
make html
CIBW_DEBUG_TRACEBACK: True
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Build wheels
uses: pypa/[email protected]
with:
output-dir: dist
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: rbcl-${{ github.ref_name }}-${{ matrix.python.abi }}-manylinux2014_aarch64
path: dist/*.whl
musllinux_1_2_aarch64:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- { version: '3.8', abi: 'cp38' }
- { version: '3.9', abi: 'cp39' }
- { version: '3.10', abi: 'cp310' }
- { version: '3.11', abi: 'cp311' }
- { version: '3.12', abi: 'cp312' }
name: Python ${{ matrix.python.version }} with ABI ${{ matrix.python.abi }} for musllinux_1_2_aarch64
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS_LINUX: "aarch64"
CIBW_BUILD: "${{ matrix.python.abi }}-musllinux_aarch64"
CIBW_PROJECT_REQUIRES_PYTHON: ">=${{ matrix.python.version }}"
CIBW_ENVIRONMENT: LIBSODIUM_MAKE_ARGS="-j$(nproc)"
CIBW_BEFORE_ALL: >
pip install .[build] -v
CIBW_REPAIR_WHEEL_COMMAND: ""
CIBW_TEST_EXTRAS: "lint,test,docs"
CIBW_BEFORE_TEST: >
cd {project} &&
cp build/lib*/rbcl/_sodium.py src/rbcl/_sodium.py &&
pip3 install pystache~=0.6 setuptools &&
apk add wget &&
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz &&
mv libsodium-1.0.18.tar.gz src/rbcl/libsodium.tar.gz
CIBW_TEST_COMMAND: >
cd {project} &&
python -m pylint rbcl src/rbcl/_sodium.tmpl src/rbcl/_sodium_build.py --disable=duplicate-code &&
python src/rbcl/rbcl.py -v &&
python -m pytest &&
cd docs &&
sphinx-apidoc -f -E --templatedir=_templates -o _source .. ../src/rbcl/_sodium_build.py ** &&
make html
CIBW_DEBUG_TRACEBACK: True
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Build wheels
uses: pypa/[email protected]
with:
output-dir: dist
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: rbcl-${{ github.ref_name }}-${{ matrix.python.abi }}-musllinux_1_2_aarch64
path: dist/*.whl
musllinux_1_2_x86_64:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- { version: '3.8', abi: 'cp38' }
- { version: '3.9', abi: 'cp39' }
- { version: '3.10', abi: 'cp310' }
- { version: '3.11', abi: 'cp311' }
- { version: '3.12', abi: 'cp312' }
name: Python ${{ matrix.python.version }} with ABI ${{ matrix.python.abi }} for musllinux_1_2_x86_64
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS_LINUX: "x86_64"
CIBW_BUILD: "${{ matrix.python.abi }}-musllinux_x86_64"
CIBW_PROJECT_REQUIRES_PYTHON: ">=${{ matrix.python.version }}"
CIBW_ENVIRONMENT: LIBSODIUM_MAKE_ARGS="-j$(nproc)"
CIBW_BEFORE_ALL: >
pip install .[build] -v
CIBW_REPAIR_WHEEL_COMMAND: ""
CIBW_TEST_EXTRAS: "lint,test,docs"
CIBW_BEFORE_TEST: >
cd {project} &&
cp build/lib*/rbcl/_sodium.py src/rbcl/_sodium.py &&
pip3 install pystache~=0.6 setuptools &&
apk add wget &&
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz &&
mv libsodium-1.0.18.tar.gz src/rbcl/libsodium.tar.gz
CIBW_TEST_COMMAND: >
cd {project} &&
python -m pylint rbcl src/rbcl/_sodium.tmpl src/rbcl/_sodium_build.py --disable=duplicate-code &&
python src/rbcl/rbcl.py -v &&
python -m pytest &&
cd docs &&
sphinx-apidoc -f -E --templatedir=_templates -o _source .. ../src/rbcl/_sodium_build.py ** &&
make html
CIBW_DEBUG_TRACEBACK: True
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
with:
output-dir: dist
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: rbcl-${{ github.ref_name }}-${{ matrix.python.abi }}-musllinux_1_2_x86_64
path: dist/*.whl