From 586a6b0970e780260fde308a14d51608a7835d87 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 18 Jan 2025 10:25:59 +0100 Subject: [PATCH 1/2] ci(gha): add tests on ubuntu-24.04-arm --- .github/workflows/test.yml | 6 +++--- README.md | 4 ++-- examples/github-deploy.yml | 2 +- examples/github-minimal.yml | 2 +- examples/github-with-qemu.yml | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3e9800e0c..0056c2864 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-13, macos-14] + os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14] python_version: ['3.13'] include: - os: ubuntu-latest @@ -89,7 +89,7 @@ jobs: with: package-dir: sample_proj output-dir: wheelhouse_only - only: cp312-${{ runner.os == 'Linux' && 'manylinux_x86_64' || (runner.os == 'Windows' && 'win_amd64' || 'macosx_x86_64') }} + only: cp312-${{ runner.os == 'Linux' && (runner.arch == 'ARM64' && 'manylinux_aarch64' || 'manylinux_x86_64') || (runner.os == 'Windows' && 'win_amd64' || 'macosx_x86_64') }} - name: Create custom configuration file shell: bash @@ -124,7 +124,7 @@ jobs: - name: Test cibuildwheel run: | - uv run bin/run_tests.py --run-podman + uv run bin/run_tests.py ${{ (runner.os == 'Linux' && runner.arch == 'X64') && '--run-podman' || '' }} emulated-archs: name: Get qemu emulated architectures diff --git a/README.md b/README.md index fbd3a1860..cb7c457cc 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Usage | | Linux | macOS | Windows | Linux ARM | macOS ARM | Windows ARM | |-----------------|-------|-------|---------|-----------|-----------|-------------| -| GitHub Actions | ✅ | ✅ | ✅ | ✅¹ | ✅ | ✅² | +| GitHub Actions | ✅ | ✅ | ✅ | ✅ | ✅ | ✅² | | Azure Pipelines | ✅ | ✅ | ✅ | | ✅ | ✅² | | Travis CI | ✅ | | ✅ | ✅ | | | | AppVeyor | ✅ | ✅ | ✅ | | ✅ | ✅² | @@ -88,7 +88,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-13, macos-latest] + os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-latest] steps: - uses: actions/checkout@v4 diff --git a/examples/github-deploy.yml b/examples/github-deploy.yml index 23cf6cea2..433adf5b3 100644 --- a/examples/github-deploy.yml +++ b/examples/github-deploy.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: # macos-13 is an intel runner, macos-14 is apple silicon - os: [ubuntu-latest, windows-latest, macos-13, macos-14] + os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14] steps: - uses: actions/checkout@v4 diff --git a/examples/github-minimal.yml b/examples/github-minimal.yml index b83d8210c..d857b6448 100644 --- a/examples/github-minimal.yml +++ b/examples/github-minimal.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: # macos-13 is an intel runner, macos-14 is apple silicon - os: [ubuntu-latest, windows-latest, macos-13, macos-14] + os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14] steps: - uses: actions/checkout@v4 diff --git a/examples/github-with-qemu.yml b/examples/github-with-qemu.yml index 390b872ee..a33c424d5 100644 --- a/examples/github-with-qemu.yml +++ b/examples/github-with-qemu.yml @@ -9,13 +9,13 @@ jobs: strategy: matrix: # macos-13 is an intel runner, macos-14 is apple silicon - os: [ubuntu-latest, windows-latest, macos-13, macos-14] + os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14] steps: - uses: actions/checkout@v4 - name: Set up QEMU - if: runner.os == 'Linux' + if: runner.os == 'Linux' && runner.arch == 'X64' uses: docker/setup-qemu-action@v3 with: platforms: all @@ -25,7 +25,7 @@ jobs: env: # configure cibuildwheel to build native archs ('auto'), and some # emulated ones - CIBW_ARCHS_LINUX: auto aarch64 ppc64le s390x + CIBW_ARCHS_LINUX: ${{ runner.arch == 'X64' && 'auto ppc64le s390x' || 'auto armv7l' }} - uses: actions/upload-artifact@v4 with: From efaf0564e9000bb5f444c7dfadc474b8926165e1 Mon Sep 17 00:00:00 2001 From: mayeut Date: Mon, 20 Jan 2025 20:53:19 +0100 Subject: [PATCH 2/2] address review comments --- examples/github-with-qemu.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/github-with-qemu.yml b/examples/github-with-qemu.yml index a33c424d5..ed4836a9c 100644 --- a/examples/github-with-qemu.yml +++ b/examples/github-with-qemu.yml @@ -23,8 +23,12 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 env: - # configure cibuildwheel to build native archs ('auto'), and some - # emulated ones + # configure cibuildwheel on Linux to build native archs ('auto'), + # and to split the remaining architectures between the x86_64 and + # ARM runners + # armv7l can be built without QEMU on GitHub Actions ARM runners but that's + # not the case on all ARM64 hardware hence 'auto armv7l' for native archs + # on the GHA ARM64 runner CIBW_ARCHS_LINUX: ${{ runner.arch == 'X64' && 'auto ppc64le s390x' || 'auto armv7l' }} - uses: actions/upload-artifact@v4