From f327f732984c9d77456557e9c685fc0ec23d1640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Date: Mon, 5 Aug 2024 13:48:53 +0100 Subject: [PATCH] CI: avoid mixing caches from different OSes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a bug in setup-ocaml@v3 https://github.com/ocaml/setup-ocaml/issues/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 --- .github/workflows/setup-xapi-environment/action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/setup-xapi-environment/action.yml b/.github/workflows/setup-xapi-environment/action.yml index 72700599cf2..ed9b7793bbe 100644 --- a/.github/workflows/setup-xapi-environment/action.yml +++ b/.github/workflows/setup-xapi-environment/action.yml @@ -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 @@ -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