Skip to content

Commit

Permalink
GHA: Add src_ext/Makefile.dune to the archive cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Mar 5, 2024
1 parent 80f643f commit 6ff2174
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.ml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ 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 }}" (if_windows ("-" ^ host) "") version;
key = Printf.sprintf "${{ runner.os }}%s-ocaml-%s-${{ %s.outputs.ocaml-cache }}-${{ %s.outputs.archives }}" (if_windows ("-" ^ host) "") version version;
id = "ocaml-cache";
force_gzip = is_windows;
paths = [if_windows {|D:\Cache\ocaml-local.tar|} "~/.cache/ocaml-local/**"];
Expand Down Expand Up @@ -487,7 +487,7 @@ let main oc : unit =
("CYGWIN_EPOCH", "3");
] in
let keys = [
("archives", "archives-1-${{ hashFiles('src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }}");
("archives", "archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }}");
("ocaml-cache", "${{ hashFiles('.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/create-ocaml-cache.sh') }}");
("cygwin", "${{ hashFiles('.github/scripts/cygwin.cmd') }}-${{ env.CYGWIN_EPOCH }}");
("opam-bs-cache", "${{ hashFiles('.github/scripts/main/opam-bs-cache.sh', '*.opam', '.github/scripts/main/preamble.sh') }}");
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ jobs:
- name: Determine cache keys
id: keys
run: |
echo archives=archives-1-${{ hashFiles('src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }}
echo archives=archives-1-${{ hashFiles('src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }} >> $GITHUB_OUTPUT
echo archives=archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }}
echo archives=archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }} >> $GITHUB_OUTPUT
echo ocaml-cache=${{ hashFiles('.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/create-ocaml-cache.sh') }}
echo ocaml-cache=${{ hashFiles('.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/create-ocaml-cache.sh') }} >> $GITHUB_OUTPUT
echo cygwin=${{ hashFiles('.github/scripts/cygwin.cmd') }}-${{ env.CYGWIN_EPOCH }}
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.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 }}
Expand Down Expand Up @@ -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 }}-${{ needs.Analyse.outputs.ocaml-cache }}
key: ${{ runner.os }}-${{ matrix.host }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.outputs.ocaml-cache }}-${{ needs.Analyse.outputs.archives }}
force-gzip: true
- name: Unpack Cygwin
shell: cmd
Expand Down Expand Up @@ -245,7 +245,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.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 }}
Expand Down Expand Up @@ -285,7 +285,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.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 }}
Expand Down Expand Up @@ -339,7 +339,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.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 }}
Expand Down Expand Up @@ -428,7 +428,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.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 }}
Expand Down Expand Up @@ -474,7 +474,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.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 }}
Expand Down Expand Up @@ -517,7 +517,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.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 }}
Expand Down Expand Up @@ -548,7 +548,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/ocaml-local/**
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }}
key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ ${{ matrix.ocamlv }}.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 }}
Expand Down

0 comments on commit 6ff2174

Please sign in to comment.