Skip to content

Commit

Permalink
CI: avoid mixing caches from different OSes
Browse files Browse the repository at this point in the history
This is a bug in setup-ocaml@v3 ocaml/setup-ocaml#839

Work it around by defining our own cache prefix based on runner OS version.

Unfortunately the version itself doesn't seem to be available as a variable in GH actions.
There is 'runner.os', but that is just a generic Linux, there is 'matrix.os', but that is only present when using a matrix,
and there is '..container' which is only present when containers are used.

Signed-off-by: Edwin Török <[email protected]>
  • Loading branch information
edwintorok committed Aug 5, 2024
1 parent cb3cd2d commit f327f73
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/setup-xapi-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ runs:
shell: bash
run: |
curl --fail --silent https://raw.githubusercontent.com/xapi-project/xs-opam/master/tools/xs-opam-ci.env | cut -f2 -d " " > .env
cat /etc/os-release >>.env
cat .env
- name: Download XE_SR_ERRORCODES.xml
shell: bash
Expand Down Expand Up @@ -52,6 +54,7 @@ runs:
xs-opam: ${{ steps.dotenv.outputs.repository }}
dune-cache: true
opam-pin: false
cache-prefix: v3-${{ env.ID }}-${{ env.VERSION_ID }}
env:
DUNE_CACHE_STORAGE_MODE: copy

Expand Down

0 comments on commit f327f73

Please sign in to comment.