Skip to content

Commit

Permalink
Parallelize wheel jobs and add ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
Legrandin committed Jan 17, 2025
1 parent f3bd9bb commit 23b7a8d
Showing 1 changed file with 103 additions and 3 deletions.
106 changes: 103 additions & 3 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,82 @@ jobs:
name: source
path: ./dist/*.tar.gz

build_python3_wheels:
build_python3_wheels_linux_x86:
name: Build Python 3 wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
os: ubuntu-22.04

if: github.actor == 'Legrandin'

steps:
- uses: actions/checkout@v3

- uses: pypa/[email protected]
name: Build wheels
env:
# cibuildwheel will build wheel once and test it for each CPython version
# and for PyPy > 3.8.
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*"
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
CIBW_MANYLINUX_I686_IMAGE: "manylinux2014"
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: "manylinux2014"
CIBW_MANYLINUX_PYPY_I686_IMAGE: "manylinux2014"
CIBW_FREE_THREADED_SUPPORT: "true"
CIBW_BEFORE_TEST_LINUX: "(ldd /bin/ls | grep -q musl && apk add gmp) || true"

# Set pycryptodome/x test command according to built package
CIBW_TEST_COMMAND:
"${{ endsWith(github.ref, 'x') == true &&
'python -m Cryptodome.SelfTest --skip-slow-tests' ||
'python -m Crypto.SelfTest --skip-slow-tests' }}"

- name: Delete manylinux1 wheels
run: |
rm -f wheelhouse/*-manylinux1_i686.whl
rm -f wheelhouse/*-manylinux1_x86_64.whl
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl

build_python3_wheels_windows:
name: Build Python 3 wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, windows-2019, macos-13]
os: windows-2019

if: github.actor == 'Legrandin'

steps:
- uses: actions/checkout@v3

- uses: pypa/[email protected]
name: Build wheels
env:
# cibuildwheel will build wheel once and test it for each CPython version
# and for PyPy > 3.8.
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*"
CIBW_FREE_THREADED_SUPPORT: "true"

# Set pycryptodome/x test command according to built package
CIBW_TEST_COMMAND:
"${{ endsWith(github.ref, 'x') == true &&
'python -m Cryptodome.SelfTest --skip-slow-tests' ||
'python -m Crypto.SelfTest --skip-slow-tests' }}"

- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl

build_python3_wheels_macos:
name: Build Python 3 wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: macos-13

if: github.actor == 'Legrandin'

Expand All @@ -42,7 +112,37 @@ jobs:
- name: Select architecture for MacOS
run: |
echo 'CIBW_ARCHS=x86_64 universal2' >> $GITHUB_ENV
if: runner.os == 'macOS'
- uses: pypa/[email protected]
name: Build wheels
env:
# cibuildwheel will build wheel once and test it for each CPython version
# and for PyPy > 3.8.
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*"
CIBW_FREE_THREADED_SUPPORT: "true"

# Set pycryptodome/x test command according to built package
CIBW_TEST_COMMAND:
"${{ endsWith(github.ref, 'x') == true &&
'python -m Cryptodome.SelfTest --skip-slow-tests' ||
'python -m Crypto.SelfTest --skip-slow-tests' }}"

- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl

build_python3_wheels_linux_arm:
name: Build Python 3 wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ubuntu-22.04-arm

if: github.actor == 'Legrandin'

steps:
- uses: actions/checkout@v3

- uses: pypa/[email protected]
name: Build wheels
Expand Down

0 comments on commit 23b7a8d

Please sign in to comment.