3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-09-04 02:28:07 +00:00
This commit is contained in:
Jonathan Kelley 2025-01-28 21:52:44 -08:00
parent bd6c4068e7
commit 07fbca13c8
No known key found for this signature in database
GPG key ID: 1FBB50F7EB0A08BE
4 changed files with 22 additions and 29 deletions

View file

@ -139,7 +139,6 @@ export class CacheConfig {
self.restoreKey = key;
// Construct the lockfiles portion of the key:
// This considers all the files found via globbing for various manifests
// and lockfiles.
@ -266,13 +265,6 @@ export class CacheConfig {
key += `-${lockHash}`;
self.cacheKey = key;
if (self.incremental) {
// wire the incremental key to be just for this branch
const branchName = core.getInput("incremental-key") || "-shared";
const incrementalKey = key + `-incremental` + branchName;
self.incrementalKey = incrementalKey;
}
self.cachePaths = [path.join(CARGO_HOME, "registry"), path.join(CARGO_HOME, "git")];
if (self.cacheBin) {
self.cachePaths = [
@ -292,7 +284,15 @@ export class CacheConfig {
self.cachePaths.push(dir);
}
const bins = await getCargoBins();
self.cargoBins = Array.from(bins.values());
if (self.incremental) {
// wire the incremental key to be just for this branch
const branchName = core.getInput("incremental-key") || "-shared";
const incrementalKey = key + `-incremental--` + branchName;
self.incrementalKey = incrementalKey;
if (cacheTargets === "true") {
for (const target of self.workspaces.map((ws) => ws.target)) {
self.incrementalPaths.push(path.join(target, "incremental"));
@ -300,9 +300,6 @@ export class CacheConfig {
}
}
const bins = await getCargoBins();
self.cargoBins = Array.from(bins.values());
return self;
}

View file

@ -74,7 +74,7 @@ async function run() {
setCacheHitOutput(match);
} else {
core.info("No cache found.");
core.info(`No cache found for ${config.cacheKey} - this key was found ${restoreKey}`);
config.saveState();
setCacheHitOutput(false);