Add aarch64 wheels to CI (#14212)

Co-authored-by: David Robertson <david.m.robertson1@gmail.com>
pull/14230/head
MichaIng 2022-10-18 19:12:21 +02:00 committed by GitHub
parent 85aa0f513b
commit 06b0c4edfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 5 deletions

View File

@ -95,11 +95,14 @@ jobs:
path: debs/* path: debs/*
build-wheels: build-wheels:
name: Build wheels on ${{ matrix.os }} name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [ubuntu-20.04, macos-10.15] os: [ubuntu-20.04, macos-10.15]
arch: [x86_64, aarch64]
# is_pr is a flag used to exclude certain jobs from the matrix on PRs.
# It is not read by the rest of the workflow.
is_pr: is_pr:
- ${{ startsWith(github.ref, 'refs/pull/') }} - ${{ startsWith(github.ref, 'refs/pull/') }}
@ -107,6 +110,12 @@ jobs:
# Don't build macos wheels on PR CI. # Don't build macos wheels on PR CI.
- is_pr: true - is_pr: true
os: "macos-10.15" os: "macos-10.15"
# Don't build aarch64 wheels on mac.
- os: "macos-10.15"
arch: aarch64
# Don't build aarch64 wheels on PR CI.
- is_pr: true
arch: aarch64
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -120,11 +129,19 @@ jobs:
- name: Install cibuildwheel - name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.9.0 poetry==1.2.0 run: python -m pip install cibuildwheel==2.9.0 poetry==1.2.0
# Only build a single wheel in CI. - name: Set up QEMU to emulate aarch64
- name: Set env vars. if: matrix.arch == 'aarch64'
run: | uses: docker/setup-qemu-action@v2
echo "CIBW_BUILD="cp37-manylinux_x86_64"" >> $GITHUB_ENV with:
platforms: arm64
- name: Build aarch64 wheels
if: matrix.arch == 'aarch64'
run: echo 'CIBW_ARCHS_LINUX=aarch64' >> $GITHUB_ENV
- name: Only build a single wheel on PR
if: startsWith(github.ref, 'refs/pull/') if: startsWith(github.ref, 'refs/pull/')
run: echo "CIBW_BUILD="cp37-manylinux_${{ matrix.arch }}"" >> $GITHUB_ENV
- name: Build wheels - name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse run: python -m cibuildwheel --output-dir wheelhouse
@ -132,6 +149,9 @@ jobs:
# Skip testing for platforms which various libraries don't have wheels # Skip testing for platforms which various libraries don't have wheels
# for, and so need extra build deps. # for, and so need extra build deps.
CIBW_TEST_SKIP: pp39-* *i686* *musl* pp37-macosx* CIBW_TEST_SKIP: pp39-* *i686* *musl* pp37-macosx*
# Fix Rust OOM errors on emulated aarch64: https://github.com/rust-lang/cargo/issues/10583
CARGO_NET_GIT_FETCH_WITH_CLI: true
CIBW_ENVIRONMENT_PASS_LINUX: CARGO_NET_GIT_FETCH_WITH_CLI
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:

View File

@ -0,0 +1 @@
Build and publish binary wheels for `aarch64` platforms.