Skip to content

Commit

Permalink
Split build wheels by x86_64 and arm wheels jobs, add support for armv7l
Browse files Browse the repository at this point in the history
  • Loading branch information
jamie256 committed Nov 21, 2023
1 parent ea02fd1 commit 18f8eb3
Showing 1 changed file with 43 additions and 14 deletions.
57 changes: 43 additions & 14 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: Build Python Wheels

on:
# allow manual runs
workflow_dispatch:
# run when we tag a release
release:
types:
- "created"
types: ["created"]

env:
BUILD_TYPE: Release
Expand Down Expand Up @@ -36,7 +33,7 @@ jobs:
with:
path: dist/*.tar.gz

build_wheels:
build_wheels_x86_64:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
Expand All @@ -55,20 +52,13 @@ jobs:
arch: x86_64,
cc: "gcc", cxx: "g++"
}
- {
name: "Ubuntu Latest, GCC, aarch64",
os: ubuntu-latest,
arch: aarch64,
cc: "gcc", cxx: "g++"
}
- {
name: "Windows Latest, MSVC",
os: windows-latest,
arch: x86_64,
cc: "cl", cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
}

steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -88,14 +78,14 @@ jobs:
platforms: arm64

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.7.0
run: python -m pip install cibuildwheel==2.16.2

- name: Build wheels
run: python -m cibuildwheel --output-dir dist
env:
CIBW_PRERELEASE_PYTHONS: True # enable Python 3.11
CIBW_SKIP: "*-win32"
CIBW_BUILD: "cp36-*64 cp37-*64 cp38-*64 cp39-*64 cp310-*64 cp311-*64"
CIBW_BUILD: "cp36-*64 cp37-*64 cp38-*64 cp39-*64 cp310-*64 cp311-*64 cp312-*64"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_ARCHS_MACOS: "x86_64 universal2"
CIBW_ARCHS_LINUX: ${{ matrix.config.arch }}
Expand All @@ -105,3 +95,42 @@ jobs:
- uses: actions/upload-artifact@v2
with:
path: ./dist/*.whl

build_wheels_arm:
name: "ARM Wheels"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Set up Qemu for ARM builds
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.2

- name: Build ARM wheels
run: python -m cibuildwheel --output-dir dist
env:
CIBW_PRERELEASE_PYTHONS: True
CIBW_SKIP: "*-win32 *-manylinux_i686"
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*"
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
CIBW_MANYLINUX_ARMV7L_IMAGE: manylinux2014
CIBW_ARCHS_LINUX: "aarch64 armv7l"
CIBW_BEFORE_TEST: pip install pytest numpy
CIBW_TEST_COMMAND: 'python -m pytest {package}/python/tests'

- uses: actions/upload-artifact@v2
with:
path: ./dist/*.whl

0 comments on commit 18f8eb3

Please sign in to comment.