@@ -21,17 +21,27 @@ jobs:
21
21
# The container already comes with all required tools pre-installed
22
22
# (see https://github.com/rescript-lang/docker-rescript-ci-build/blob/main/Dockerfile).
23
23
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}}
25
30
26
31
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
28
33
29
34
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
+
30
40
- name : Checkout
31
41
uses : actions/checkout@v3
32
42
33
43
- name : Build compiler binaries
34
- run : opam exec -- dune build --profile static
44
+ run : opam exec -- dune build --display quiet -- profile static
35
45
36
46
- name : Build ninja binary
37
47
working-directory : ninja
@@ -42,11 +52,52 @@ jobs:
42
52
- name : " Upload artifacts"
43
53
uses : actions/upload-artifact@v3
44
54
with :
45
- name : static-binaries-linux
55
+ name : static-binaries-linux-${{runner.arch}}
46
56
path : |
47
57
_build/install/default/bin
48
58
ninja/ninja
49
59
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
+
50
101
build :
51
102
needs : static-binaries-linux
52
103
77
128
if : runner.os == 'Linux'
78
129
uses : actions/download-artifact@v3
79
130
with :
80
- name : static-binaries-linux
131
+ name : static-binaries-linux-${{ runner.arch }}
81
132
82
133
- name : Make static linux binaries executable
83
134
if : runner.os == 'Linux'
97
148
98
149
- name : " Build compiler"
99
150
if : runner.os != 'Linux'
100
- run : opam exec -- dune build --profile release
151
+ run : opam exec -- dune build --display quiet -- profile release
101
152
102
153
- name : Use Node.js
103
154
uses : actions/setup-node@v3
@@ -236,7 +287,14 @@ jobs:
236
287
strategy :
237
288
fail-fast : false
238
289
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
+ ]
240
298
241
299
runs-on : ${{matrix.os}}
242
300
0 commit comments