Skip to content

Commit

Permalink
CI: build ARM platforms on GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed Dec 18, 2024
1 parent acb22de commit d58e3ce
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 35 deletions.
37 changes: 26 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,39 @@ jobs:
python-version: "3.x"
- uses: pre-commit/[email protected]

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 }}
Expand All @@ -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
Expand Down
24 changes: 0 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d58e3ce

Please sign in to comment.