From 60c4c3c4ec6ef1ec668247c9d3f38941695458d9 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Mon, 14 Sep 2026 04:42:46 +0000 Subject: [PATCH] Prevent intermittent OCaml CI setup failures Use the official HTTP OPAM repository to avoid the Git maintenance race during repository initialization. Version the custom cache namespaces so existing Git-backed OPAM roots are not restored. Signed-off-by: Christoph Knittel --- .github/actions/setup-ocaml/action.yml | 5 +++++ .github/workflows/ci.yml | 2 +- .github/workflows/coverage.yml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-ocaml/action.yml b/.github/actions/setup-ocaml/action.yml index fc8c788610..97098cf74f 100644 --- a/.github/actions/setup-ocaml/action.yml +++ b/.github/actions/setup-ocaml/action.yml @@ -104,6 +104,11 @@ runs: uses: ocaml/setup-ocaml@v3.8.0 with: ocaml-compiler: ${{ inputs.compiler }} + # Use the HTTP repository to prevent intermittent CI setup failures: + # the Git-backed default can race with detached Git maintenance while + # OPAM scans it (https://github.com/ocaml/opam/issues/7031). + opam-repositories: | + default: https://opam.ocaml.org opam-pin: false cache: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c26588ac4b..baa311be88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,7 +117,7 @@ jobs: with: compiler: ${{ matrix.ocaml_compiler }} os: ${{ matrix.os }} - cache-prefix: opam-env-v8 + cache-prefix: opam-env-v9 - name: Compiler build state key id: compiler-build-state-key diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index af2f13cbbe..733caa109e 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -44,7 +44,7 @@ jobs: with: compiler: ${{ env.OCAML_COMPILER }} os: ${{ env.OS }} - cache-prefix: opam-coverage-v1 + cache-prefix: opam-coverage-v2 dependency-flags: --deps-only --with-test --with-dev-setup - name: Install OCaml coverage tooling