From d58e3ced09bc7692ba94197aa0e106c030989c09 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 24 Nov 2024 14:59:09 +0100 Subject: [PATCH] CI: build ARM platforms on GHA --- .github/workflows/build.yml | 37 ++++++++++++++++++++++++++----------- .travis.yml | 24 ------------------------ 2 files changed, 26 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6dde683e..e3f9d68f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,22 +38,39 @@ jobs: python-version: "3.x" - uses: pre-commit/action@v3.0.1 + build_matrix: + needs: pre_commit + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.matrix.outputs.matrix }} + steps: + - id: matrix + name: build matrix + shell: python + run: | + import os + import json + reduced = [ + ("x86_64", "ubuntu-22.04", ("manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2")), + ("aarch64", "ubuntu-22.04", ("manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2")), + ("i686", "ubuntu-22.04", ("manylinux2014", "musllinux_1_2")), + ("armv7l", "ubuntu-22.04", ("manylinux_2_31", "musllinux_1_2")), + ] + expanded = [{"policy": policy, "platform": platform, "runner": runner} for platform, runner, policies in reduced for policy in policies] + print(json.dumps(expanded, indent=2)) + with open(os.environ["GITHUB_OUTPUT"], "at") as f: + f.write(f"matrix={json.dumps(expanded)}") + build_manylinux: - needs: [pre_commit] name: ${{ matrix.policy }}_${{ matrix.platform }} - runs-on: ubuntu-22.04 + needs: build_matrix + runs-on: ${{ matrix.runner }} permissions: actions: write # this permission is needed to delete cache strategy: fail-fast: false matrix: - policy: ["manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2"] - platform: ["x86_64"] - include: - - policy: "manylinux2014" - platform: "i686" - - policy: "musllinux_1_2" - platform: "i686" + include: ${{ fromJson(needs.build_matrix.outputs.matrix) }} env: POLICY: ${{ matrix.policy }} PLATFORM: ${{ matrix.platform }} @@ -68,8 +85,6 @@ jobs: - name: Set up emulation if: matrix.platform != 'i686' && matrix.platform != 'x86_64' uses: docker/setup-qemu-action@v3 - with: - platforms: ${{ matrix.platform }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/.travis.yml b/.travis.yml index 6e0e97c1..63c3f842 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,42 +29,18 @@ env: jobs: include: - - arch: arm64-graviton2 - virt: vm - group: edge - env: POLICY="manylinux2014" PLATFORM="aarch64" - arch: s390x env: POLICY="manylinux2014" PLATFORM="s390x" - arch: ppc64le env: POLICY="manylinux2014" PLATFORM="ppc64le" - - arch: arm64-graviton2 - virt: vm - group: edge - env: POLICY="manylinux_2_28" PLATFORM="aarch64" - arch: s390x env: POLICY="manylinux_2_28" PLATFORM="s390x" - arch: ppc64le env: POLICY="manylinux_2_28" PLATFORM="ppc64le" - - arch: arm64-graviton2 - virt: vm - group: edge - env: POLICY="manylinux_2_31" PLATFORM="armv7l" - - arch: arm64-graviton2 - virt: vm - group: edge - env: POLICY="manylinux_2_34" PLATFORM="aarch64" - arch: s390x env: POLICY="manylinux_2_34" PLATFORM="s390x" - arch: ppc64le env: POLICY="manylinux_2_34" PLATFORM="ppc64le" - - arch: arm64-graviton2 - virt: vm - group: edge - env: POLICY="musllinux_1_2" PLATFORM="aarch64" - - arch: arm64-graviton2 - virt: vm - group: edge - env: POLICY="musllinux_1_2" PLATFORM="armv7l" - arch: s390x env: POLICY="musllinux_1_2" PLATFORM="s390x" - arch: ppc64le