@@ -245,10 +245,9 @@ jobs:
245
245
~/.opam
246
246
_opam
247
247
.opam-path
248
- .opam-env
249
248
D:\cygwin
250
249
D:\.opam
251
- key : opam-env-v10 -${{ matrix.os }}-${{ hashFiles('dune-project') }}
250
+ key : opam-env-v1 -${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project') }}
252
251
253
252
- name : Use OCaml ${{matrix.ocaml_compiler}}
254
253
uses : ocaml/setup-ocaml@v3.0.0
@@ -257,12 +256,20 @@ jobs:
257
256
ocaml-compiler : ${{matrix.ocaml_compiler}}
258
257
opam-pin : false
259
258
260
- - name : Get OPAM environment
259
+ - name : Get OPAM executable path
261
260
if : steps.cache-opam-env.outputs.cache-hit != 'true'
262
- shell : bash
263
- run : |
264
- which opam | tee .opam-path
265
- opam env > .opam-env
261
+ uses : actions/github-script@v7
262
+ with :
263
+ result-encoding : string
264
+ script : |
265
+ const opamPath = await io.which('opam', true);
266
+ console.log('opam executable found: %s', opamPath);
267
+
268
+ const fs = require('fs/promises');
269
+ await fs.writeFile('.opam-path', opamPath, 'utf-8');
270
+ console.log('stored path to .opam-path');
271
+
272
+ return opamPath;
266
273
267
274
- name : Install OPAM dependencies
268
275
if : steps.cache-opam-env.outputs.cache-hit != 'true'
@@ -277,10 +284,9 @@ jobs:
277
284
~/.opam
278
285
_opam
279
286
.opam-path
280
- .opam-env
281
287
D:\cygwin
282
288
D:\.opam
283
- key : opam-env-v10 -${{ matrix.os }}-${{ hashFiles('dune-project') }}
289
+ key : opam-env-v1 -${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project') }}
284
290
285
291
- name : Use cached OPAM environment
286
292
if : steps.cache-opam-env.outputs.cache-hit == 'true'
@@ -296,7 +302,7 @@ jobs:
296
302
if [[ "$RUNNER_OS" != "Windows" ]]; then
297
303
echo "OPAMROOT=$HOME/.opam" >> "$GITHUB_ENV"
298
304
else
299
- echo "OPAMROOT=D:\\.opam" >> "$GITHUB_ENV"
305
+ echo "OPAMROOT=D:\\.opam" >> "$GITHUB_ENV"
300
306
fi
301
307
302
308
OPAM_PATH="$(cat .opam-path)"
0 commit comments