@@ -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,10 +248,9 @@ 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-v10 -${{ 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
256
uses : ocaml/setup-ocaml@v3.0.0
@@ -257,12 +259,17 @@ jobs:
257
259
ocaml-compiler : ${{matrix.ocaml_compiler}}
258
260
opam-pin : false
259
261
260
- - name : Get OPAM environment
262
+ - name : Get OPAM executable path
261
263
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
264
+ uses : actions/github-script@v7
265
+ with :
266
+ script : |
267
+ const opamPath = await io.which('opam', true);
268
+ console.log('opam executable found: %s', opamPath);
269
+
270
+ const fs = require('fs/promises');
271
+ await fs.writeFile('.opam-path', opamPath, 'utf-8');
272
+ console.log('stored path to .opam-path');
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