Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): fix ci to restore the cache #18215

Merged
merged 3 commits into from
Mar 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Better.
  • Loading branch information
dsherret committed Mar 15, 2023
commit d2dce5d5d4f125e3b950bbb47cc7a9a70cf0bc22
11 changes: 5 additions & 6 deletions .github/workflows/ci.generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ const Runners = {
macos: "macos-12",
windows: `\${{ ${windowsRunnerCondition} }}`,
};
// bump this when you want to purge the cache
const cacheVersion = 19;
// bump the number at the start when you want to purge the cache
const cacheKeyPrefix =
"19-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-";

const installPkgsCommand =
"sudo apt-get install --no-install-recommends debootstrap clang-15 lld-15";
Expand Down Expand Up @@ -444,8 +445,7 @@ const ci = {
"!./target/*/*.tar.gz",
].join("\n"),
key: "never_saved",
"restore-keys": cacheVersion +
"-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-",
"restore-keys": cacheKeyPrefix,
},
},
{
Expand Down Expand Up @@ -859,8 +859,7 @@ const ci = {
"!./target/*/*.zip",
"!./target/*/*.tar.gz",
].join("\n"),
key: cacheVersion +
"-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ github.sha }}",
key: cacheKeyPrefix + "${{ github.sha }}",
},
},
]),
Expand Down