Skip to content

Commit 199993e

Browse files
committed
Include setup-ocaml version in cache key
1 parent a24ebb8 commit 199993e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ jobs:
7575

7676
runs-on: ${{matrix.os}}
7777

78+
env:
79+
# Also adjust in `uses:` when changed!
80+
# This version of setup-ocaml comes with OPAM 2.4.0.
81+
SETUP_OCAML_VERSION: 3.4.0
82+
7883
steps:
7984
- name: "Windows: Set git config"
8085
if: runner.os == 'Windows'
@@ -141,7 +146,7 @@ jobs:
141146
# matrix.ocaml_compiler may contain commas
142147
- name: Get OPAM cache key
143148
shell: bash
144-
run: echo "opam_cache_key=opam-env-v8-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" | sed 's/,/-/g' >> $GITHUB_ENV
149+
run: echo "opam_cache_key=opam-env-v8-${{ matrix.os }}-${{ env.SETUP_OCAML_VERSION }}-{{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" | sed 's/,/-/g' >> $GITHUB_ENV
145150

146151
- name: Restore OPAM environment
147152
id: cache-opam-env
@@ -157,7 +162,7 @@ jobs:
157162
key: ${{ env.opam_cache_key }}
158163

159164
- name: Use OCaml ${{matrix.ocaml_compiler}}
160-
uses: ocaml/setup-ocaml@v3.3.2
165+
uses: ocaml/setup-ocaml@v3.4.0
161166
if: steps.cache-opam-env.outputs.cache-hit != 'true'
162167
with:
163168
ocaml-compiler: ${{matrix.ocaml_compiler}}

0 commit comments

Comments
 (0)