From cb3cd2d7dd864c807825ee75c560867aaf9bdc5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Date: Mon, 5 Aug 2024 13:57:21 +0100 Subject: [PATCH 1/2] CI: use ubuntu-22.04 for SDK too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To better share caches with the main run. Once `feature/py3` is merged, we can move all this to 24.04. Signed-off-by: Edwin Török --- .github/workflows/generate-and-build-sdks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-and-build-sdks.yml b/.github/workflows/generate-and-build-sdks.yml index 87da4b1d8f5..53ada2588da 100644 --- a/.github/workflows/generate-and-build-sdks.yml +++ b/.github/workflows/generate-and-build-sdks.yml @@ -10,7 +10,7 @@ on: jobs: generate-sdk-sources: name: Generate SDK sources - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@v4 From aeeade16aa2c332a8b1976b75927f3b1bd3c27d4 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 2/2] 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. Use another GH action to determine the version, and now the cache-prefix looks like this: ``` cache-prefix: v3-Ubuntu-22.04 ``` Signed-off-by: Edwin Török --- .github/workflows/setup-xapi-environment/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/setup-xapi-environment/action.yml b/.github/workflows/setup-xapi-environment/action.yml index 72700599cf2..541510bb8f8 100644 --- a/.github/workflows/setup-xapi-environment/action.yml +++ b/.github/workflows/setup-xapi-environment/action.yml @@ -12,6 +12,7 @@ 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 - name: Download XE_SR_ERRORCODES.xml shell: bash @@ -42,6 +43,10 @@ runs: echo "TMPDIR=${TMPDIR}" >>"$GITHUB_ENV" echo "XDG_CACHE_HOME=${XDG_CACHE_HOME}" >>"$GITHUB_ENV" + - name: Get runner OS info + uses: kenchan0130/actions-system-info@master + id: system-info + # We set DUNE_CACHE_STORAGE_MODE, it is required for dune cache to work inside opam for now, # otherwise it gets EXDEV and considers it a cache miss - name: Use ocaml @@ -52,6 +57,7 @@ runs: xs-opam: ${{ steps.dotenv.outputs.repository }} dune-cache: true opam-pin: false + cache-prefix: v3-${{ steps.system-info.outputs.name }}-${{ steps.system-info.outputs.release }} env: DUNE_CACHE_STORAGE_MODE: copy