From 80b21958b64feff71066fdd635b85321fee6733a Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Wed, 20 Sep 2023 22:11:14 -0400 Subject: [PATCH] build linux-aarch64 wheel on self-hosted runner (#2851) ..., which should be much faster than using QEMU on x86. The runner is a free Oracle ARM Ampere A1 Compute instance. --------- Signed-off-by: Jinzhe Zeng --- .github/workflows/build_wheel.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index 49ed433609..2dcec8c0bd 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -5,8 +5,24 @@ on: pull_request: jobs: + determine-arm64-runner: + runs-on: ubuntu-latest + permissions: read-all + outputs: + runner: ${{ steps.set-runner.outputs.runner }} + steps: + - name: Determine which runner to use for ARM64 build + id: set-runner + run: | + if [ "${{ github.repository_owner }}" == "deepmodeling" ]; then + echo "runner=[\"Linux\",\"ARM64\"]" >> $GITHUB_OUTPUT + else + echo "runner=\"ubuntu-latest\"" >> $GITHUB_OUTPUT + fi + build_wheels: name: Build wheels for cp${{ matrix.python }}-${{ matrix.platform_id }} + needs: determine-arm64-runner runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -33,7 +49,7 @@ jobs: platform_id: win_amd64 dp_variant: cpu # linux-aarch64 - - os: ubuntu-latest + - os: ${{ fromJson(needs.determine-arm64-runner.outputs.runner) }} python: 310 platform_id: manylinux_aarch64 dp_variant: cpu @@ -45,7 +61,7 @@ jobs: fetch-depth: 0 - uses: docker/setup-qemu-action@v3 name: Setup QEMU - if: matrix.platform_id == 'manylinux_aarch64' + if: matrix.platform_id == 'manylinux_aarch64' && matrix.os == 'ubuntu-latest' - name: Build wheels uses: pypa/cibuildwheel@v2.15 env: