diff --git a/.github/workflows/ci.ml b/.github/workflows/ci.ml index 95e71522813..55808f635b1 100644 --- a/.github/workflows/ci.ml +++ b/.github/workflows/ci.ml @@ -170,20 +170,15 @@ let get_cache name = get_cache_cont name Fun.id let cache ?cond ?(key_prefix="needs.Analyse") ?(check_only=false) name = get_cache_cont name (fun cache -> - let action = - if cache.force_gzip || check_only then - "ocaml-opam/cache@opam" - else - "actions/cache@v3" - in + let action = "actions/cache@v4" in let withs = if cache.force_gzip then - [("force-gzip", Literal ["true"])] + [("enableCrossOsArchive", Literal ["true"])] else [] in let withs = if check_only then - ("check-only", Literal ["true"]) :: withs + ("lookup-only", Literal ["true"]) :: withs else withs in let withs = @@ -329,7 +324,7 @@ let main_build_job ~analyse_job ~cygwin_job ?section runner start_version ~oc ~w ~cond:(Predicate(true, EndsWith("matrix.host", "-pc-windows"))) ~withs:[ ("name", Literal ["opam-exe-${{ matrix.host }}-${{ matrix.ocamlv }}-${{ matrix.build }}"]); ("path", Literal ["D:\\Local\\bin\\opam.exe"; "D:\\Local\\bin\\opam-installer.exe"; "D:\\Local\\bin\\opam-putenv.exe"]) ] - "actions/upload-artifact@v3") + "actions/upload-artifact@v4") ++ only_on Windows (run "Test (basic - Cygwin)" ~cond:(Predicate(true, EndsWith("matrix.host", "-pc-cygwin"))) ["bash -exu .github/scripts/main/test.sh"]) ++ only_on Windows (run "Test (basic - native Windows)" ~env:[("OPAMROOT", {|D:\a\opam\opam\.opam|})] ~shell:"cmd" ~cond:(Predicate(false, EndsWith("matrix.host", "-pc-cygwin"))) ({|set Path=D:\Cache\ocaml-local\bin;%Path%|} :: diff --git a/.github/workflows/depexts.yml b/.github/workflows/depexts.yml index c28c2b1a684..7e59185114a 100644 --- a/.github/workflows/depexts.yml +++ b/.github/workflows/depexts.yml @@ -26,7 +26,7 @@ jobs: steps: - name: opam binary cache id: binary - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} @@ -43,9 +43,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: opam binary cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} @@ -61,9 +61,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: opam binary cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} @@ -79,9 +79,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: opam binary cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} @@ -97,9 +97,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: opam binary cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} @@ -115,9 +115,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: opam binary cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} @@ -133,9 +133,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: opam binary cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} @@ -151,9 +151,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: opam binary cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} @@ -169,9 +169,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: opam binary cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} @@ -187,9 +187,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: opam binary cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: binary/opam key: binary-${{ env.OPAMVERSION }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e1928496e4a..4d7d9624140 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -66,14 +66,14 @@ jobs: echo opam-bs-cache=${{ hashFiles('.github/scripts/main/opam-bs-cache.sh', '*.opam', '.github/scripts/main/preamble.sh') }} >> $GITHUB_OUTPUT - name: src_ext/archives and opam-repository Cache id: archives - uses: ocaml-opam/cache@opam + uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ steps.keys.outputs.archives }} - check-only: true - force-gzip: true + lookup-only: true + enableCrossOsArchive: true - name: Create src_ext/archives and opam-repository cache if: steps.archives.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/archives-cache.sh @@ -84,12 +84,12 @@ jobs: steps: - name: Cygwin64 Cache id: cygwin64 - uses: ocaml-opam/cache@opam + uses: actions/cache@v4 with: path: D:\Cache\cygwin\x86_64-pc-cygwin key: cygwin64-${{ needs.Analyse.outputs.cygwin }} - check-only: true - force-gzip: true + lookup-only: true + enableCrossOsArchive: true - name: Checkout tree if: steps.cygwin64.outputs.cache-hit != 'true' uses: actions/checkout@v4 @@ -115,16 +115,16 @@ jobs: uses: actions/checkout@v4 - name: src_ext/archives and opam-repository Cache id: archives - uses: ocaml-opam/cache@opam + uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} - force-gzip: true + enableCrossOsArchive: true - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} @@ -160,27 +160,27 @@ jobs: - name: Cygwin64 Cache id: cygwin64 if: matrix.build == 'x86_64-pc-cygwin' - uses: ocaml-opam/cache@opam + uses: actions/cache@v4 with: path: D:\Cache\cygwin\x86_64-pc-cygwin key: cygwin64-${{ needs.Analyse.outputs.cygwin }} - force-gzip: true + enableCrossOsArchive: true - name: src_ext/archives and opam-repository Cache id: archives - uses: ocaml-opam/cache@opam + uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} - force-gzip: true + enableCrossOsArchive: true - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache - uses: ocaml-opam/cache@opam + uses: actions/cache@v4 with: path: D:\Cache\ocaml-local.tar key: ${{ runner.os }}-${{ matrix.host }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} - force-gzip: true + enableCrossOsArchive: true - name: Unpack Cygwin shell: cmd run: .github\scripts\cygwin.cmd ${{ matrix.build }} D:\Cache\cygwin ${{ matrix.host }} @@ -193,7 +193,7 @@ jobs: run: ldd ./opam.exe | test "$(grep -v -F /cygdrive/c/Windows/)" = '' - name: Upload opam binaries for Windows if: endsWith(matrix.host, '-pc-windows') - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: opam-exe-${{ matrix.host }}-${{ matrix.ocamlv }}-${{ matrix.build }} path: | @@ -233,16 +233,16 @@ jobs: uses: actions/checkout@v4 - name: src_ext/archives and opam-repository Cache id: archives - uses: ocaml-opam/cache@opam + uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} - force-gzip: true + enableCrossOsArchive: true - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} @@ -273,16 +273,16 @@ jobs: run: sudo apt install bubblewrap - name: src_ext/archives and opam-repository Cache id: archives - uses: ocaml-opam/cache@opam + uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} - force-gzip: true + enableCrossOsArchive: true - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} @@ -291,7 +291,7 @@ jobs: run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} - name: opam bootstrap Cache id: opam-bootstrap - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ${{ env.OPAMBSROOT }}/** @@ -302,7 +302,7 @@ jobs: run: bash -exu .github/scripts/main/opam-bs-cache.sh - name: opam-rt Cache id: opam-rt - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/opam-rt/** key: ${{ runner.os }}-opam-rt-${{ matrix.ocamlv }} @@ -327,16 +327,16 @@ jobs: uses: actions/checkout@v4 - name: src_ext/archives and opam-repository Cache id: archives - uses: ocaml-opam/cache@opam + uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} - force-gzip: true + enableCrossOsArchive: true - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} @@ -345,7 +345,7 @@ jobs: run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} - name: opam bootstrap Cache id: opam-bootstrap - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ${{ env.OPAMBSROOT }}/** @@ -356,7 +356,7 @@ jobs: run: bash -exu .github/scripts/main/opam-bs-cache.sh - name: opam-rt Cache id: opam-rt - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/opam-rt/** key: ${{ runner.os }}-opam-rt-${{ matrix.ocamlv }} @@ -380,13 +380,13 @@ jobs: uses: actions/checkout@v4 - name: src_ext/archives and opam-repository Cache id: archives - uses: ocaml-opam/cache@opam + uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} - force-gzip: true + enableCrossOsArchive: true - name: Cold run: | make compiler @@ -415,16 +415,16 @@ jobs: uses: actions/checkout@v4 - name: src_ext/archives and opam-repository Cache id: archives - uses: ocaml-opam/cache@opam + uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} - force-gzip: true + enableCrossOsArchive: true - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} @@ -433,7 +433,7 @@ jobs: run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} - name: opam bootstrap Cache id: opam-bootstrap - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ${{ env.OPAMBSROOT }}/** @@ -461,16 +461,16 @@ jobs: uses: actions/checkout@v4 - name: src_ext/archives and opam-repository Cache id: archives - uses: ocaml-opam/cache@opam + uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} - force-gzip: true + enableCrossOsArchive: true - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} @@ -479,7 +479,7 @@ jobs: run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} - name: opam bootstrap Cache id: opam-bootstrap - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ${{ env.OPAMBSROOT }}/** @@ -507,13 +507,13 @@ jobs: - name: Checkout tree uses: actions/checkout@v4 - name: opam 1.2 root Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.OPAM12CACHE }} key: ${{ runner.os }}-opam1.2-root - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} @@ -538,13 +538,13 @@ jobs: - name: Checkout tree uses: actions/checkout@v4 - name: opam 1.2 root Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.OPAM12CACHE }} key: ${{ runner.os }}-opam1.2-root - name: OCaml ${{ matrix.ocamlv }} Cache id: ocaml-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/ocaml-local/** key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} @@ -571,13 +571,13 @@ jobs: uses: actions/checkout@v4 - name: src_ext/archives and opam-repository Cache id: archives - uses: ocaml-opam/cache@opam + uses: actions/cache@v4 with: path: | src_ext/archives ~/opam-repository key: ${{ needs.Analyse.outputs.archives }} - force-gzip: true + enableCrossOsArchive: true - name: Get changed files id: files uses: Ana06/get-changed-files@v2.2.0 diff --git a/master_changes.md b/master_changes.md index 2a005c0d86f..3d0a0e96851 100644 --- a/master_changes.md +++ b/master_changes.md @@ -118,6 +118,10 @@ users) * Depexts: set version for conf packages to check [#6079 @rjbou] * Depexts: add package to test containing `os-version` in filter [#6079 @rjbou] * Depexts: fix opensuse job [#6079 @rjbou] + * Use actions/cache instead of our own fork ocaml-opam/cache [#6081 @rjbou] + * Update action cache to v4 [#6081 @rjbou] + * Update action checkout to v4 [#6081 @rjbou] + * Update action upload-artifact to v4 [#6081 @rjbou] ## Doc