@@ -187,6 +187,9 @@ jobs:
187
187
runs-on : ${{matrix.os}}
188
188
189
189
env :
190
+ # setup-ocaml opam version cannot be configured
191
+ # we do track its version mannually
192
+ OPAM_VERSION : 2.2.0
190
193
DUNE_PROFILE : release
191
194
192
195
steps :
@@ -245,36 +248,28 @@ jobs:
245
248
~/.opam
246
249
_opam
247
250
.opam-path
248
- .opam-env
249
251
D:\cygwin
250
252
D:\.opam
251
- key : opam-env-v8 -${{ matrix.os }}-${{ hashFiles('dune-project') }}
253
+ key : opam-env-v1 -${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project') }}
252
254
253
255
- name : Use OCaml ${{matrix.ocaml_compiler}}
254
- uses : ocaml/setup-ocaml@v2
255
- if : steps.cache-opam-env.outputs.cache-hit != 'true' && matrix.os != 'windows-latest'
256
+ uses : ocaml/setup-ocaml@v3.0.0
257
+ if : steps.cache-opam-env.outputs.cache-hit != 'true'
256
258
with :
257
259
ocaml-compiler : ${{matrix.ocaml_compiler}}
258
260
opam-pin : false
259
- opam-depext : false
260
261
261
- - name : Use OCaml ${{matrix.ocaml_compiler}} (Windows)
262
- uses : ocaml/setup-ocaml@v2
263
- if : steps.cache-opam-env.outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
262
+ - name : Get OPAM executable path
263
+ if : steps.cache-opam-env.outputs.cache-hit != 'true'
264
+ uses : actions/github-script@v7
264
265
with :
265
- ocaml-compiler : ocaml-variants.5.2.0+options,ocaml-option-mingw
266
- opam-pin : false
267
- opam-depext : false
268
- opam-repositories : |
269
- windows-5.0: https://github.com/dra27/opam-repository.git#windows-5.0
270
- sunset: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
271
- default: https://github.com/ocaml/opam-repository.git
266
+ script : |
267
+ const opamPath = await io.which('opam', true);
268
+ console.log('opam executable found: %s', opamPath);
272
269
273
- - name : Get OPAM environment
274
- if : steps.cache-opam-env.outputs.cache-hit != 'true'
275
- run : |
276
- command -v opam | tee .opam-path
277
- opam env > .opam-env
270
+ const fs = require('fs/promises');
271
+ await fs.writeFile('.opam-path', opamPath, 'utf-8');
272
+ console.log('stored path to .opam-path');
278
273
279
274
- name : Install OPAM dependencies
280
275
if : steps.cache-opam-env.outputs.cache-hit != 'true'
@@ -289,10 +284,9 @@ jobs:
289
284
~/.opam
290
285
_opam
291
286
.opam-path
292
- .opam-env
293
287
D:\cygwin
294
288
D:\.opam
295
- key : opam-env-v8 -${{ matrix.os }}-${{ hashFiles('dune-project') }}
289
+ key : opam-env-v1 -${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project') }}
296
290
297
291
- name : Use cached OPAM environment
298
292
if : steps.cache-opam-env.outputs.cache-hit == 'true'
@@ -308,15 +302,14 @@ jobs:
308
302
if [[ "$RUNNER_OS" != "Windows" ]]; then
309
303
echo "OPAMROOT=$HOME/.opam" >> "$GITHUB_ENV"
310
304
else
311
- echo "OPAMROOT=D:\\.opam" >> "$GITHUB_ENV"
305
+ echo "OPAMROOT=D:\\.opam" >> "$GITHUB_ENV"
312
306
fi
313
307
314
- if [[ "$RUNNER_OS" != "Windows" ]]; then
315
- OPAM_PATH="$(cat .opam-path)"
316
- chmod +x "$OPAM_PATH"
317
- dirname "$OPAM_PATH" >> "$GITHUB_PATH"
308
+ OPAM_PATH="$(cat .opam-path)"
309
+ chmod +x "$OPAM_PATH"
310
+ dirname "$OPAM_PATH" >> "$GITHUB_PATH"
318
311
319
- else
312
+ if [[ "$RUNNER_OS" == "Windows" ]]; then
320
313
fsutil behavior query SymlinkEvaluation
321
314
fsutil behavior set symlinkEvaluation R2L:1 R2R:1
322
315
fsutil behavior query SymlinkEvaluation
@@ -365,6 +358,8 @@ jobs:
365
358
- name : " Check if syntax subfolder has changed"
366
359
id : syntax-diff
367
360
shell : bash
361
+ env :
362
+ SHELLOPTS : igncr # see https://github.com/ocaml/setup-ocaml/issues/815
368
363
run : |
369
364
if git diff --name-only --exit-code HEAD^ HEAD -- jscomp/syntax; then
370
365
echo "syntax_status=unchanged" >> $GITHUB_ENV
@@ -519,7 +514,9 @@ jobs:
519
514
path : packages/test
520
515
521
516
- name : Install ReScript package
522
- run : npm i rescript-${{ needs.package.outputs.rescript_version }}.tgz
517
+ run : |
518
+ npm i --ignore-scripts --no-audit \
519
+ rescript-${{ needs.package.outputs.rescript_version }}.tgz
523
520
shell : bash
524
521
working-directory : packages/test
525
522
0 commit comments