Skip to content

Commit

Permalink
chore(ci): fix ci to restore the cache (denoland#18215)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Mar 15, 2023
1 parent fb021d7 commit 1c285ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const Runners = {
macos: "macos-12",
windows: `\${{ ${windowsRunnerCondition} }}`,
};
// bump the number at the start when you want to purge the cache
const cacheKeyPrefix =
"18-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-";

const installPkgsCommand =
"sudo apt-get install --no-install-recommends debootstrap clang-15 lld-15";
Expand Down Expand Up @@ -442,8 +445,7 @@ const ci = {
"!./target/*/*.tar.gz",
].join("\n"),
key: "never_saved",
"restore-keys":
"19-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-",
"restore-keys": cacheKeyPrefix,
},
},
{
Expand Down Expand Up @@ -857,8 +859,7 @@ const ci = {
"!./target/*/*.zip",
"!./target/*/*.tar.gz",
].join("\n"),
key:
"18-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ github.sha }}",
key: cacheKeyPrefix + "${{ github.sha }}",
},
},
]),
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ jobs:
!./target/*/*.zip
!./target/*/*.tar.gz
key: never_saved
restore-keys: '19-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-'
restore-keys: '18-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-'
- name: Apply and update mtime cache
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != ''true'' && (!startsWith(github.ref, ''refs/tags/'')))'
uses: ./.github/mtime_cache
Expand Down

0 comments on commit 1c285ac

Please sign in to comment.