Skip to content

Commit

Permalink
[CI] Add matrix strategy to CI workflow for multi-arch builds
Browse files Browse the repository at this point in the history
* The CI pipeline now supports builds for both x86-64 and aarch64-linux platforms by introducing a matrix strategy.

* Additionally, steps have been included to set up QEMU for ARM64 and improved configurations for Nix to better handle multi-arch builds.

* Ref based on https://lgug2z.com/articles/building-and-privately-caching-x86-and-aarch64-nixos-systems-on-github-actions
  • Loading branch information
daspk04 committed Jul 29, 2024
1 parent 8b54f10 commit 5758cc1
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,25 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
machine:
- host: amd64
platform: x86-64-linux
- host: arm64
platform: arm64-linux
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- if: matrix.machine.platform == 'aarch64-linux'
uses: docker/setup-qemu-action@v3
- uses: DeterminateSystems/nix-installer-action@main
with:
diagnostic-endpoint: ""
- run: nix build .
extra-conf: |
fallback = true
http-connections = 128
max-substitution-jobs = 128
extra-platforms = aarch64-linux
- name: Build system
run: |
nix build --system ${{ matrix.machine.platform }} .

0 comments on commit 5758cc1

Please sign in to comment.