@@ -213,26 +213,26 @@ jobs:
213
213
chmod +x rewatch/rewatch
214
214
chmod +x _build/install/default/bin/*
215
215
216
- - name : Restore OPAM env
217
- id : cache-opam-env
216
+ - name : Restore OPAM tool
217
+ id : cache-opam-tool
218
218
uses : actions/cache/restore@v4
219
219
with :
220
220
path : |
221
221
${{ runner.tool_cache }}/opam
222
222
~/.opam
223
- key : opam-env -v1-${{ runner .os }}-${{ hashFiles('dune-project') }}
223
+ key : opam-tool -v1-${{ matrix .os }}-${{ hashFiles('dune-project') }}
224
224
225
225
- name : Use OCaml ${{matrix.ocaml_compiler}}
226
226
uses : ocaml/setup-ocaml@v2
227
- if : steps.cache-opam-env .outputs.cache-hit != 'true' && matrix.os != 'windows-latest'
227
+ if : steps.cache-opam-tool .outputs.cache-hit != 'true' && matrix.os != 'windows-latest'
228
228
with :
229
229
ocaml-compiler : ${{matrix.ocaml_compiler}}
230
230
opam-pin : false
231
231
opam-depext : false
232
232
233
233
- name : Use OCaml ${{matrix.ocaml_compiler}} (Win)
234
234
uses : ocaml/setup-ocaml@v2
235
- if : steps.cache-opam-env .outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
235
+ if : steps.cache-opam-tool .outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
236
236
with :
237
237
ocaml-compiler : ocaml-variants.5.2.0+options,ocaml-option-mingw
238
238
opam-pin : false
@@ -243,50 +243,55 @@ jobs:
243
243
default: https://github.com/ocaml/opam-repository.git
244
244
245
245
- name : Install OPAM dependencies
246
- if : steps.cache-opam-env .outputs.cache-hit != 'true'
246
+ if : steps.cache-opam-tool .outputs.cache-hit != 'true'
247
247
run : opam install . --deps-only
248
248
249
- - name : Cache OPAM env
250
- if : steps.cache-opam-env .outputs.cache-hit != 'true'
249
+ - name : Save OPAM tool
250
+ if : steps.cache-opam-tool .outputs.cache-hit != 'true'
251
251
uses : actions/cache/save@v4
252
252
with :
253
253
path : |
254
254
${{ runner.tool_cache }}/opam
255
255
~/.opam
256
- key : opam-env -v1-${{ runner .os }}-${{ hashFiles('dune-project') }}
256
+ key : opam-tool -v1-${{ matrix .os }}-${{ hashFiles('dune-project') }}
257
257
258
- - name : Get OPAM path
259
- if : steps.cache-opam-env .outputs.cache-hit != 'true'
258
+ - name : Get OPAM env
259
+ if : steps.cache-opam-tool .outputs.cache-hit != 'true'
260
260
run : |
261
- which opam
262
261
which opam > .opam-path
262
+ opam env > .opam-env
263
263
264
- - name : Cache OPAM path
265
- id : cache-opam-path
266
- if : steps.cache-opam-env .outputs.cache-hit != 'true'
264
+ - name : Save OPAM env
265
+ id : cache-opam-env
266
+ if : steps.cache-opam-tool .outputs.cache-hit != 'true'
267
267
uses : actions/cache/save@v4
268
268
with :
269
- path : .opam-path
270
- key : opam-path-${{ runner.os }}
269
+ path : |
270
+ .opam-path
271
+ .opam-env
272
+ key : opam-path-${{ matrix.os }}
271
273
272
- - name : Restore OPAM path
273
- if : steps.cache-opam-env .outputs.cache-hit == 'true'
274
+ - name : Restore OPAM env
275
+ if : steps.cache-opam-tool .outputs.cache-hit == 'true'
274
276
uses : actions/cache/restore@v4
275
277
with :
276
- path : .opam-path
277
- key : opam-path-${{ runner.os }}
278
+ path : |
279
+ .opam-path
280
+ .opam-env
281
+ key : opam-path-${{ matrix.os }}
278
282
279
- - name : Use cached OPAM env
280
- if : steps.cache-opam-env .outputs.cache-hit == 'true'
283
+ - name : Use cached OPAM env - $PATH
284
+ if : steps.cache-opam-tool .outputs.cache-hit == 'true'
281
285
run : |
282
286
OPAM_PATH="$(cat .opam-path)"
283
- chmod +x $OPAM_PATH
284
- dirname $OPAM_PATH >> $GITHUB_PATH
287
+ chmod +x " $OPAM_PATH"
288
+ dirname " $OPAM_PATH" >> " $GITHUB_PATH"
285
289
286
- - name : Use cached OPAM env
287
- if : steps.cache-opam-env .outputs.cache-hit == 'true'
290
+ - name : Use cached OPAM env - Environment variables
291
+ if : steps.cache-opam-tool .outputs.cache-hit == 'true'
288
292
run : |
289
- opam env | sed "s/'//g; s/; export .*//g" >> $GITHUB_ENV
293
+ OPAM_ENV="$(cat .opam-env)"
294
+ sed "s/'//g; s/; export .*//g" "$OPAM_ENV" >> "$GITHUB_ENV"
290
295
291
296
- name : " Build compiler"
292
297
if : runner.os != 'Linux'
0 commit comments