@@ -21,17 +21,27 @@ jobs:
2121 # The container already comes with all required tools pre-installed
2222 # (see https://github.com/rescript-lang/docker-rescript-ci-build/blob/main/Dockerfile).
2323 static-binaries-linux :
24- runs-on : ubuntu-latest
24+ strategy :
25+ fail-fast : false
26+ matrix :
27+ os : [ubuntu-latest, buildjet-2vcpu-ubuntu-2204-arm]
28+
29+ runs-on : ${{matrix.os}}
2530
2631 container :
27- image : ghcr.io/rescript-lang/rescript-ci-build:v1.0 .0
32+ image : ghcr.io/rescript-lang/rescript-ci-build:v1.1 .0
2833
2934 steps :
35+ # See https://github.com/actions/runner/issues/801#issuecomment-1374967227.
36+ - name : Workaround for Github actions runner on Alpine arm64
37+ if : runner.arch == 'ARM64'
38+ run : sed -i "s:ID=alpine:ID=NotpineForGHA:" /etc/os-release
39+
3040 - name : Checkout
3141 uses : actions/checkout@v3
3242
3343 - name : Build compiler binaries
34- run : opam exec -- dune build --profile static
44+ run : opam exec -- dune build --display quiet -- profile static
3545
3646 - name : Build ninja binary
3747 working-directory : ninja
@@ -42,11 +52,52 @@ jobs:
4252 - name : " Upload artifacts"
4353 uses : actions/upload-artifact@v3
4454 with :
45- name : static-binaries-linux
55+ name : static-binaries-linux-${{runner.arch}}
4656 path : |
4757 _build/install/default/bin
4858 ninja/ninja
4959
60+ # The full build including tests does not work on Linux ARM because setup-ocaml fails.
61+ # Therefore, only upload the binaries from the static build
62+ upload-linux-arm64-binaries :
63+ needs :
64+ - static-binaries-linux
65+
66+ runs-on : buildjet-2vcpu-ubuntu-2204-arm
67+
68+ steps :
69+ - name : Checkout
70+ uses : actions/checkout@v3
71+
72+ - name : Download static linux binaries
73+ if : runner.os == 'Linux'
74+ uses : actions/download-artifact@v3
75+ with :
76+ name : static-binaries-linux-${{ runner.arch }}
77+
78+ - name : Make static linux binaries executable
79+ if : runner.os == 'Linux'
80+ run : |
81+ chmod +x ninja/ninja
82+ chmod +x _build/install/default/bin/*
83+
84+ - name : Use Node.js
85+ uses : actions/setup-node@v3
86+ with :
87+ node-version : 16
88+
89+ - name : Copy exes to platform bin dirs
90+ run : node ./scripts/copyExes.js
91+
92+ - name : Prepare artifact upload
93+ run : node .github/workflows/get_artifact_info.js
94+
95+ - name : " Upload artifacts: binaries"
96+ uses : actions/upload-artifact@v3
97+ with :
98+ name : ${{ env.artifact_name }}
99+ path : ${{ env.artifact_path }}
100+
50101 build :
51102 needs : static-binaries-linux
52103
77128 if : runner.os == 'Linux'
78129 uses : actions/download-artifact@v3
79130 with :
80- name : static-binaries-linux
131+ name : static-binaries-linux-${{ runner.arch }}
81132
82133 - name : Make static linux binaries executable
83134 if : runner.os == 'Linux'
97148
98149 - name : " Build compiler"
99150 if : runner.os != 'Linux'
100- run : opam exec -- dune build --profile release
151+ run : opam exec -- dune build --display quiet -- profile release
101152
102153 - name : Use Node.js
103154 uses : actions/setup-node@v3
@@ -236,7 +287,14 @@ jobs:
236287 strategy :
237288 fail-fast : false
238289 matrix :
239- os : [macos-latest, ubuntu-latest, windows-latest, macos-arm]
290+ os :
291+ [
292+ macos-latest,
293+ macos-arm,
294+ ubuntu-latest,
295+ buildjet-2vcpu-ubuntu-2204-arm,
296+ windows-latest,
297+ ]
240298
241299 runs-on : ${{matrix.os}}
242300
0 commit comments