@@ -16,256 +16,27 @@ env:
16
16
DUNE_PROFILE : release
17
17
18
18
jobs :
19
- # Build statically linked Linux binaries in an Alpine-based Docker container
20
- # See https://ocamlpro.com/blog/2021_09_02_generating_static_and_portable_executables_with_ocaml
21
- # for more info.
22
- # The container already comes with all required tools pre-installed
23
- # (see https://github.com/rescript-lang/docker-rescript-ci-build/blob/main/Dockerfile).
24
- static-binaries-linux :
19
+ armv7-linux :
25
20
runs-on : ubuntu-latest
26
21
27
- container :
28
- image : ghcr.io/rescript-lang/rescript-ci-build
29
-
30
- steps :
31
- - name : Checkout
32
- uses : actions/checkout@v3
33
-
34
- - name : Apply static linking patch
35
- run : git apply scripts/dune-static-linking.patch
36
-
37
- - name : Build compiler binaries
38
- run : opam exec -- dune build
39
-
40
- - name : Build ninja binary
41
- working-directory : ninja
42
- env :
43
- LDFLAGS : -static
44
- run : python3 configure.py --bootstrap --verbose
45
-
46
- - name : " Upload artifacts"
47
- uses : actions/upload-artifact@v3
48
- with :
49
- name : static-binaries-linux
50
- path : |
51
- _build/install/default/bin
52
- ninja/ninja
53
-
54
- build :
55
- needs : static-binaries-linux
56
-
57
- strategy :
58
- fail-fast : false
59
- matrix :
60
- os : [macos-latest, ubuntu-latest, windows-latest, macos-arm]
61
- ocaml_compiler : [4.14.0]
62
-
63
- runs-on : ${{matrix.os}}
64
-
65
- env :
66
- OCAMLRUNPARAM : b
67
- DUNE_PROFILE : release
68
-
69
22
steps :
70
- - name : " Windows: Set git to use LF"
71
- if : runner.os == 'Windows'
72
- run : |
73
- git config --global core.autocrlf false
74
- git config --global core.eol lf
75
-
76
23
- name : Checkout
77
24
uses : actions/checkout@v3
78
- with :
79
- fetch-depth : 2 # to be able to check for changes in subfolder res_syntax later
80
-
81
- - name : Download static linux binaries
82
- if : runner.os == 'Linux'
83
- uses : actions/download-artifact@v3
84
- with :
85
- name : static-binaries-linux
86
-
87
- - name : Make static linux binaries executable
88
- if : runner.os == 'Linux'
89
- run : |
90
- chmod +x ninja/ninja
91
- chmod +x _build/install/default/bin/*
92
-
93
- - name : Use OCaml ${{matrix.ocaml_compiler}}
94
- uses : ocaml/setup-ocaml@v2
95
- with :
96
- ocaml-compiler : ${{matrix.ocaml_compiler}}
97
- opam-pin : false
98
- opam-depext : false
99
-
100
- - name : " Install OPAM dependencies"
101
- run : opam install . --deps-only
102
-
103
- - name : " Build compiler"
104
- if : runner.os != 'Linux'
105
- run : opam exec -- dune build
106
-
107
- - name : Use Node.js
108
- uses : actions/setup-node@v3
109
- with :
110
- node-version : 16
111
-
112
- - name : Install npm packages
113
- run : npm ci --ignore-scripts
114
-
115
- - name : " Windows: Use MSVC for ninja build"
116
- if : runner.os == 'Windows'
117
- uses : TheMrMilchmann/setup-msvc-dev@v2
118
- with :
119
- arch : x64
120
-
121
- - name : Build ninja
122
- if : runner.os != 'Linux'
123
- run : node scripts/buildNinjaBinary.js
124
-
125
- - name : Copy exes to platform bin dirs
126
- run : node ./scripts/copyExes.js
127
-
128
- - name : " Check if syntax subfolder has changed"
129
- id : syntax-diff
130
- shell : bash
131
- run : |
132
- if git diff --name-only --exit-code HEAD^ HEAD -- res_syntax; then
133
- echo "syntax_status=unchanged" >> $GITHUB_ENV
134
- else
135
- echo "syntax_status=changed" >> $GITHUB_ENV
136
- fi
137
-
138
- - name : " Syntax: Run roundtrip tests"
139
- if : ${{ env.syntax_status == 'changed' && runner.os != 'Windows' }}
140
- run : make test-syntax-roundtrip
141
-
142
- - name : " Syntax: Run tests (Windows)"
143
- if : ${{ env.syntax_status == 'changed' && runner.os == 'Windows' }}
144
- run : make test-syntax
145
-
146
- - name : Build runtime/stdlib
147
- if : runner.os != 'Windows'
148
- run : |
149
- opam exec -- node ./scripts/ninja.js config
150
- opam exec -- node ./scripts/ninja.js build
151
-
152
- - name : Check for changes in lib folder
153
- run : git diff --exit-code lib/js lib/es6
154
25
155
- - name : Run tests
156
- if : runner.os != 'Windows'
157
- run : node scripts/ciTest.js -all
158
-
159
- - name : Run tests (Windows)
160
- if : runner.os == 'Windows'
161
- run : node scripts/ciTest.js -mocha -theme -format
162
-
163
- - name : Prepare artifact upload
26
+ - uses : uraimo/run-on-arch-action@v2
27
+ name : Run commands
28
+ id : runcmd
29
+ with :
30
+ arch : armv7
31
+ distro : alpine_latest
32
+ githubToken : ${{ github.token }}
33
+ run : |
34
+ apk update
35
+ apk add gcc libc-dev musl-dev make opam
36
+ opam init -y --compiler=4.14.0
37
+ echo ::set-output name=uname::$(uname -a)
38
+
39
+ - name : Get the output
40
+ # Echo the `uname` output parameter from the `runcmd` step
164
41
run : |
165
- ./scripts/prebuilt.js
166
- node .github/workflows/get_artifact_info.js
167
-
168
- - name : " Upload artifacts: binaries"
169
- uses : actions/upload-artifact@v3
170
- with :
171
- name : ${{ env.artifact_name }}
172
- path : ${{ env.artifact_path }}
173
-
174
- - name : " Upload artifacts: lib/ocaml"
175
- if : runner.os == 'Linux'
176
- uses : actions/upload-artifact@v3
177
- with :
178
- name : lib-ocaml
179
- path : lib/ocaml
180
-
181
- - name : " Upload artifacts: cmi cache"
182
- if : runner.os == 'Linux'
183
- uses : actions/upload-artifact@v3
184
- with :
185
- name : cmij-cache
186
- path : |
187
- lib/cmi_cache.bin
188
- lib/cmj_cache.bin
189
-
190
- package :
191
- needs : build
192
- runs-on : ubuntu-latest
193
-
194
- steps :
195
- - name : Checkout
196
- uses : actions/checkout@v3
197
- with :
198
- submodules : true
199
-
200
- - name : Use Node.js
201
- uses : actions/setup-node@v3
202
- with :
203
- node-version : 16
204
-
205
- - name : NPM install
206
- run : npm ci --ignore-scripts
207
-
208
- - name : Download artifacts
209
- uses : actions/download-artifact@v3
210
-
211
- - name : Move artifacts
212
- run : ./scripts/moveArtifacts.sh
213
-
214
- - name : Check artifact list
215
- run : node ./scripts/makeArtifactList.js -check
216
-
217
- - name : npm pack (rescript)
218
- run : npm pack
219
-
220
- - name : Copy JS files to stdlib package
221
- run : mkdir -p packages/std/lib && cp -R lib/es6 lib/js packages/std/lib
222
-
223
- - name : npm pack (@rescript/std)
224
- run : npm pack
225
- working-directory : packages/std
226
-
227
- - name : Get package info
228
- # For pull requests, pass the correct commit SHA explicitly as GITHUB_SHA points to the wrong commit.
229
- run : node .github/workflows/get_package_info.js ${{ github.event.pull_request.head.sha }}
230
-
231
- - name : " Upload artifact: npm packages"
232
- uses : actions/upload-artifact@v3
233
- with :
234
- name : npm-packages
235
- path : |
236
- ${{ env.rescript_package }}
237
- ${{ env.stdlib_package }}
238
-
239
- installationTest :
240
- needs : package
241
- strategy :
242
- fail-fast : false
243
- matrix :
244
- os : [macos-latest, ubuntu-latest, windows-latest, macos-arm]
245
-
246
- runs-on : ${{matrix.os}}
247
-
248
- steps :
249
- - name : Checkout
250
- uses : actions/checkout@v3
251
-
252
- - name : Use Node.js
253
- uses : actions/setup-node@v3
254
- with :
255
- node-version : 16
256
-
257
- - name : Download artifacts
258
- uses : actions/download-artifact@v3
259
- with :
260
- name : npm-packages
261
- path : packages/test
262
-
263
- - name : Install ReScript package
264
- run : npm i rescript-11*.tgz
265
- shell : bash
266
- working-directory : packages/test
267
-
268
- - name : Test installation
269
- run : npx rescript -h && npx rescript build && cat src/Test.bs.js
270
- shell : bash
271
- working-directory : packages/test
42
+ echo "The uname output was ${{ steps.runcmd.outputs.uname }}"
0 commit comments