Skip to content

Commit 7f11540

Browse files
authored
Merge pull request #367 from gren-lang/linux-arm64
Run linux build with matrix strategy, adding arm64
2 parents ba2a215 + a18f80c commit 7f11540

1 file changed

Lines changed: 25 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,37 @@ jobs:
3737
run: devbox run -- npm run build
3838

3939
linux:
40-
runs-on: ubuntu-latest
4140
container: alpine:3.18
4241
needs: validate-code-formatting
42+
strategy:
43+
matrix:
44+
include:
45+
- runner: ubuntu-24.04
46+
arch: x86_64
47+
artifact: gren_linux
48+
- runner: ubuntu-24.04-arm
49+
arch: aarch64
50+
artifact: gren_linux_arm64
51+
52+
runs-on: ${{ matrix.runner }}
4353

4454
steps:
55+
- uses: laverdet/alpine-arm64@v1
56+
if: runner.arch == 'ARM64'
57+
4558
- name: Install deps
4659
run: apk add alpine-sdk autoconf gcc gmp gmp-dev libffi libffi-dev llvm15 make musl-dev ncurses-dev ncurses-static tree wget zlib-dev zlib-static curl
4760

48-
- uses: actions/checkout@v4
61+
- uses: actions/checkout@v6
4962

5063
- name: Install GHCup
51-
run: curl https://downloads.haskell.org/~ghcup/0.1.50.2/x86_64-linux-ghcup-0.1.50.2 -o /usr/local/bin/ghcup && chmod a+x /usr/local/bin/ghcup
64+
run: curl https://downloads.haskell.org/~ghcup/0.1.50.2/${{ matrix.arch }}-linux-ghcup-0.1.50.2 -o /usr/local/bin/ghcup && chmod a+x /usr/local/bin/ghcup
5265

5366
- name: Cache ghcup
54-
uses: actions/cache@v4
67+
uses: actions/cache@v5
5568
with:
5669
path: ~/.ghcup
57-
key: ghcup-linux-${{ env.ghc }}
70+
key: ghcup-linux-${{ matrix.arch }}-${{ env.ghc }}
5871

5972
- name: Install Haskell
6073
run: ghcup install ghc ${{ env.ghc }} --set && ghcup install cabal ${{ env.cabal }} --set
@@ -74,17 +87,17 @@ jobs:
7487
sed -i '$ d' cabal.project.freeze
7588
7689
- name: Cache cabal store
77-
uses: actions/cache@v4
90+
uses: actions/cache@v5
7891
with:
7992
path: ~/.local/state/cabal/store
80-
key: deps-linux-${{ env.ghc }}-${{ hashFiles('cabal.project.freeze') }}
93+
key: deps-linux-${{ matrix.arch }}-${{ env.ghc }}-${{ hashFiles('cabal.project.freeze') }}
8194

8295
- name: Cache build artifacts
83-
uses: actions/cache@v4
96+
uses: actions/cache@v5
8497
with:
8598
path: dist-newstyle
86-
key: dist-linux-${{ env.ghc }}-${{ github.sha }}
87-
restore-keys: dist-linux-${{ env.ghc }}-
99+
key: dist-linux-${{ matrix.arch }}-${{ env.ghc }}-${{ github.sha }}
100+
restore-keys: dist-linux-${{ matrix.arch }}-${{ env.ghc }}-
88101

89102
- name: Build
90103
run: cabal build
@@ -98,9 +111,9 @@ jobs:
98111
- name: Strip
99112
run: strip gren
100113

101-
- uses: actions/upload-artifact@v4
114+
- uses: actions/upload-artifact@v7
102115
with:
103-
name: gren_linux
116+
name: ${{ matrix.artifact }}
104117
path: gren
105118
retention-days: 14
106119

0 commit comments

Comments
 (0)