Skip to content

Commit 23b7a8d

Browse files
committed
Parallelize wheel jobs and add ARM
1 parent f3bd9bb commit 23b7a8d

File tree

1 file changed

+103
-3
lines changed

1 file changed

+103
-3
lines changed

.github/workflows/wheels.yml

Lines changed: 103 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,82 @@ jobs:
2727
name: source
2828
path: ./dist/*.tar.gz
2929

30-
build_python3_wheels:
30+
build_python3_wheels_linux_x86:
31+
name: Build Python 3 wheels on ${{ matrix.os }}
32+
runs-on: ${{ matrix.os }}
33+
os: ubuntu-22.04
34+
35+
if: github.actor == 'Legrandin'
36+
37+
steps:
38+
- uses: actions/checkout@v3
39+
40+
- uses: pypa/[email protected]
41+
name: Build wheels
42+
env:
43+
# cibuildwheel will build wheel once and test it for each CPython version
44+
# and for PyPy > 3.8.
45+
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*"
46+
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
47+
CIBW_MANYLINUX_I686_IMAGE: "manylinux2014"
48+
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: "manylinux2014"
49+
CIBW_MANYLINUX_PYPY_I686_IMAGE: "manylinux2014"
50+
CIBW_FREE_THREADED_SUPPORT: "true"
51+
CIBW_BEFORE_TEST_LINUX: "(ldd /bin/ls | grep -q musl && apk add gmp) || true"
52+
53+
# Set pycryptodome/x test command according to built package
54+
CIBW_TEST_COMMAND:
55+
"${{ endsWith(github.ref, 'x') == true &&
56+
'python -m Cryptodome.SelfTest --skip-slow-tests' ||
57+
'python -m Crypto.SelfTest --skip-slow-tests' }}"
58+
59+
- name: Delete manylinux1 wheels
60+
run: |
61+
rm -f wheelhouse/*-manylinux1_i686.whl
62+
rm -f wheelhouse/*-manylinux1_x86_64.whl
63+
64+
- uses: actions/upload-artifact@v3
65+
with:
66+
name: wheels
67+
path: ./wheelhouse/*.whl
68+
69+
build_python3_wheels_windows:
3170
name: Build Python 3 wheels on ${{ matrix.os }}
3271
runs-on: ${{ matrix.os }}
3372
strategy:
3473
matrix:
35-
os: [ubuntu-22.04, windows-2019, macos-13]
74+
os: windows-2019
75+
76+
if: github.actor == 'Legrandin'
77+
78+
steps:
79+
- uses: actions/checkout@v3
80+
81+
- uses: pypa/[email protected]
82+
name: Build wheels
83+
env:
84+
# cibuildwheel will build wheel once and test it for each CPython version
85+
# and for PyPy > 3.8.
86+
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*"
87+
CIBW_FREE_THREADED_SUPPORT: "true"
88+
89+
# Set pycryptodome/x test command according to built package
90+
CIBW_TEST_COMMAND:
91+
"${{ endsWith(github.ref, 'x') == true &&
92+
'python -m Cryptodome.SelfTest --skip-slow-tests' ||
93+
'python -m Crypto.SelfTest --skip-slow-tests' }}"
94+
95+
- uses: actions/upload-artifact@v3
96+
with:
97+
name: wheels
98+
path: ./wheelhouse/*.whl
99+
100+
build_python3_wheels_macos:
101+
name: Build Python 3 wheels on ${{ matrix.os }}
102+
runs-on: ${{ matrix.os }}
103+
strategy:
104+
matrix:
105+
os: macos-13
36106

37107
if: github.actor == 'Legrandin'
38108

@@ -42,7 +112,37 @@ jobs:
42112
- name: Select architecture for MacOS
43113
run: |
44114
echo 'CIBW_ARCHS=x86_64 universal2' >> $GITHUB_ENV
45-
if: runner.os == 'macOS'
115+
116+
- uses: pypa/[email protected]
117+
name: Build wheels
118+
env:
119+
# cibuildwheel will build wheel once and test it for each CPython version
120+
# and for PyPy > 3.8.
121+
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*"
122+
CIBW_FREE_THREADED_SUPPORT: "true"
123+
124+
# Set pycryptodome/x test command according to built package
125+
CIBW_TEST_COMMAND:
126+
"${{ endsWith(github.ref, 'x') == true &&
127+
'python -m Cryptodome.SelfTest --skip-slow-tests' ||
128+
'python -m Crypto.SelfTest --skip-slow-tests' }}"
129+
130+
- uses: actions/upload-artifact@v3
131+
with:
132+
name: wheels
133+
path: ./wheelhouse/*.whl
134+
135+
build_python3_wheels_linux_arm:
136+
name: Build Python 3 wheels on ${{ matrix.os }}
137+
runs-on: ${{ matrix.os }}
138+
strategy:
139+
matrix:
140+
os: ubuntu-22.04-arm
141+
142+
if: github.actor == 'Legrandin'
143+
144+
steps:
145+
- uses: actions/checkout@v3
46146

47147
- uses: pypa/[email protected]
48148
name: Build wheels

0 commit comments

Comments
 (0)