Skip to content

Commit

Permalink
ci: replace qemu with macos-14 when building aarch64 wheels
Browse files Browse the repository at this point in the history
Wheels build for linux use docker and using arm64 mac seems to
be way faster than using qemu to emulate aarch64 on x86_64 runners.
  • Loading branch information
kelsos committed Oct 28, 2024
1 parent fd877dd commit e43c5d0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,15 @@ jobs:

build_wheels_linux:
name: 'Build wheels for Linux'
runs-on: ubuntu-20.04
runs-on: ${{ matrix.arch.os }}
strategy:
fail-fast: false
matrix:
arch: [ aarch64, native ]
arch:
- name: aarch64
os: macos-14
- name: native
os: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -142,26 +146,21 @@ jobs:
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: ${{ matrix.arch == 'aarch64' }}
with:
platforms: arm64
- name: prepare build directory
run: ./scripts/prepare.sh
run: ./scripts/prepare.sh Linux
env:
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_ARCHS_LINUX: ${{ matrix.arch.name }}
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==${{ env.CIBW_VERSION }}
- name: Build wheels
working-directory: build
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_ALL_LINUX: ./build.sh
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_ARCHS_LINUX: ${{ matrix.arch.name }}
- uses: actions/upload-artifact@v4
with:
name: pypi-wheels-linux-${{ matrix.arch }}
name: pypi-wheels-linux-${{ matrix.arch.name }}
path: build/wheelhouse/*.whl

build_wheels_windows:
Expand Down
6 changes: 5 additions & 1 deletion scripts/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ BUILD_DIR="$SOURCE_DIR/build"
SQLCIPHER_DIR="$SOURCE_DIR/sqlcipher"
PYSQLCIPHER_DIR="$SOURCE_DIR/pysqlcipher3"

BUILD_OS=$(uname -s)
if [ -z "$1" ]; then
BUILD_OS=$1
else
BUILD_OS=$(uname -s)
fi

if [[ $BUILD_OS == 'Linux' ]]; then
BUILD_PLATFORM='linux'
Expand Down

0 comments on commit e43c5d0

Please sign in to comment.