ci: speed up wheel builds, defer exotic arches to release tags
- Build aarch64 wheels on native ubuntu-24.04-arm runners instead of QEMU emulation (massive speedup on every push/PR). - Move ppc64le and s390x QEMU builds into a separate job that only runs on refs/tags/v* and skips tests (still extremely slow under emulation, but no longer gates regular CI). - Drop EOL CPython 3.8 builds, which also removes the macOS x86_64-only-installer warning. - Include arch in artifact names to make them easier to identify.
This commit is contained in:
51
.github/workflows/wheels.yml
vendored
51
.github/workflows/wheels.yml
vendored
@@ -15,12 +15,9 @@ jobs:
|
||||
arch: x86_64
|
||||
- os: ubuntu-latest
|
||||
arch: i686
|
||||
- os: ubuntu-latest
|
||||
# Native ARM runner — no QEMU, drastically faster than emulated aarch64
|
||||
- os: ubuntu-24.04-arm
|
||||
arch: aarch64
|
||||
- os: ubuntu-latest
|
||||
arch: ppc64le
|
||||
- os: ubuntu-latest
|
||||
arch: s390x
|
||||
|
||||
- os: macos-15
|
||||
arch: x86_64
|
||||
@@ -41,8 +38,38 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Build wheels
|
||||
uses: pypa/cibuildwheel@v3.4.1
|
||||
with:
|
||||
output-dir: wheelhouse
|
||||
env:
|
||||
CIBW_ARCHS: ${{ matrix.arch }}
|
||||
# Drop EOL CPython 3.8 (also avoids the macOS x86_64-only-installer warning)
|
||||
CIBW_SKIP: "cp38-*"
|
||||
CIBW_TEST_REQUIRES: pytest pytest-asyncio
|
||||
CIBW_TEST_COMMAND: pytest {project}
|
||||
# Only needed to make the macosx arm64 build work
|
||||
CMAKE_OSX_ARCHITECTURES: "${{ matrix.arch == 'arm64' && 'arm64' || '' }}"
|
||||
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: cibw-wheels-${{ matrix.os }}-${{ matrix.arch }}-${{ strategy.job-index }}
|
||||
path: ./wheelhouse/*.whl
|
||||
|
||||
# Exotic arches built via QEMU emulation — very slow (often >1h), so only run
|
||||
# on release tags rather than every push/PR.
|
||||
build_wheels_exotic:
|
||||
name: Build wheels (exotic) ${{ matrix.arch }}
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arch: [ppc64le, s390x]
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Set up QEMU
|
||||
if: runner.os == 'Linux'
|
||||
uses: docker/setup-qemu-action@v4
|
||||
|
||||
- name: Build wheels
|
||||
@@ -51,17 +78,13 @@ jobs:
|
||||
output-dir: wheelhouse
|
||||
env:
|
||||
CIBW_ARCHS: ${{ matrix.arch }}
|
||||
CIBW_TEST_REQUIRES: pytest pytest-asyncio
|
||||
CIBW_TEST_COMMAND: pytest {project}
|
||||
# cibuildwheel can build cp38 macOS universal2/arm64 wheels but can't test the
|
||||
# arm64 slice because the cp38 installer is x86_64-only. Silence the warning.
|
||||
CIBW_TEST_SKIP: "cp38-macosx_*:arm64"
|
||||
# Only needed to make the macosx arm64 build work
|
||||
CMAKE_OSX_ARCHITECTURES: "${{ matrix.arch == 'arm64' && 'arm64' || '' }}"
|
||||
CIBW_SKIP: "cp38-*"
|
||||
# Tests under QEMU are extremely slow; skip them for these arches.
|
||||
CIBW_TEST_SKIP: "*"
|
||||
|
||||
- uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
|
||||
name: cibw-wheels-${{ matrix.arch }}
|
||||
path: ./wheelhouse/*.whl
|
||||
|
||||
build_sdist:
|
||||
|
||||
Reference in New Issue
Block a user