also cache cargo install metadata

This commit is contained in:
Arpad Borsos
2024-12-29 08:47:45 +01:00
parent 720f7e45cc
commit 008623fb83
6 changed files with 56 additions and 49 deletions

View File

@@ -38,19 +38,12 @@ async function run() {
// Pass a copy of cachePaths to avoid mutating the original array as reported by:
// https://github.com/actions/toolkit/pull/1378
// TODO: remove this once the underlying bug is fixed.
const restoreKey = await cacheProvider.cache.restoreCache(
config.cachePaths.slice(),
key,
[config.restoreKey],
{ lookupOnly }
);
const restoreKey = await cacheProvider.cache.restoreCache(config.cachePaths.slice(), key, [config.restoreKey], {
lookupOnly,
});
if (restoreKey) {
const match = restoreKey === key;
core.info(
`${
lookupOnly ? "Found" : "Restored from"
} cache key "${restoreKey}" full match: ${match}.`
);
core.info(`${lookupOnly ? "Found" : "Restored from"} cache key "${restoreKey}" full match: ${match}.`);
if (!match) {
// pre-clean the target directory on cache mismatch
for (const workspace of config.workspaces) {