diff --git a/.github/workflows/ci.ml b/.github/workflows/ci.ml index 2ea12514e59..eb5dc71e518 100644 --- a/.github/workflows/ci.ml +++ b/.github/workflows/ci.ml @@ -128,7 +128,8 @@ let get_cache_cont : type s . s cache_name -> s = function | _ -> fun _ b -> b in let is_windows = if_windows true false in f {name = Printf.sprintf "OCaml %s" version; - key = Printf.sprintf "${{ runner.os }}%s-ocaml-%s-${{ %s.outputs.ocaml-cache }}-${{ %s.outputs.archives }}" (if_windows ("-" ^ host) "") version version; + key = + (fun step -> Printf.sprintf "${{ runner.os }}%s-ocaml-%s-${{ %s.outputs.ocaml-cache }}-${{ %s.outputs.archives }}" (if_windows ("-" ^ host) "") version step step); id = "ocaml-cache"; force_gzip = is_windows; paths = [if_windows {|D:\Cache\ocaml-local.tar|} "~/.cache/ocaml-local/**"]; diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a63bcb559d3..f77b4cf4150 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -127,7 +127,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -179,7 +179,7 @@ jobs: uses: ocaml-opam/cache@opam with: path: D:\Cache\ocaml-local.tar - key: ${{ runner.os }}-${{ matrix.host }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-${{ matrix.host }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} force-gzip: true - name: Unpack Cygwin shell: cmd @@ -245,7 +245,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -285,7 +285,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -339,7 +339,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -428,7 +428,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -474,7 +474,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -517,7 +517,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} @@ -548,7 +548,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/ocaml-local/** - key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} + key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }} - name: Create OCaml ${{ matrix.ocamlv }} cache if: steps.ocaml-cache.outputs.cache-hit != 'true' run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }}