From 07fbca13c8ccfacee71257f402e1ca84693d2e39 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Tue, 28 Jan 2025 21:52:44 -0800 Subject: [PATCH] hmm --- dist/restore/index.js | 16 +++++++--------- dist/save/index.js | 14 ++++++-------- src/config.ts | 19 ++++++++----------- src/restore.ts | 2 +- 4 files changed, 22 insertions(+), 29 deletions(-) diff --git a/dist/restore/index.js b/dist/restore/index.js index 697901a..cb1b9c1 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -86956,12 +86956,6 @@ class CacheConfig { self.keyFiles = sort_and_uniq(keyFiles); key += `-${lockHash}`; self.cacheKey = key; - if (self.incremental) { - // wire the incremental key to be just for this branch - const branchName = lib_core.getInput("incremental-key") || "-shared"; - const incrementalKey = key + `-incremental` + branchName; - self.incrementalKey = incrementalKey; - } self.cachePaths = [external_path_default().join(config_CARGO_HOME, "registry"), external_path_default().join(config_CARGO_HOME, "git")]; if (self.cacheBin) { self.cachePaths = [ @@ -86979,15 +86973,19 @@ class CacheConfig { for (const dir of cacheDirectories.trim().split(/\s+/).filter(Boolean)) { 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 = lib_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(external_path_default().join(target, "incremental")); } } } - const bins = await getCargoBins(); - self.cargoBins = Array.from(bins.values()); return self; } /** @@ -87459,7 +87457,7 @@ async function run() { setCacheHitOutput(match); } else { - lib_core.info("No cache found."); + lib_core.info(`No cache found for ${config.cacheKey} - this key was found ${restoreKey}`); config.saveState(); setCacheHitOutput(false); } diff --git a/dist/save/index.js b/dist/save/index.js index 877a315..56ba4fb 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -86956,12 +86956,6 @@ class CacheConfig { self.keyFiles = sort_and_uniq(keyFiles); key += `-${lockHash}`; self.cacheKey = key; - if (self.incremental) { - // wire the incremental key to be just for this branch - const branchName = lib_core.getInput("incremental-key") || "-shared"; - const incrementalKey = key + `-incremental` + branchName; - self.incrementalKey = incrementalKey; - } self.cachePaths = [external_path_default().join(CARGO_HOME, "registry"), external_path_default().join(CARGO_HOME, "git")]; if (self.cacheBin) { self.cachePaths = [ @@ -86979,15 +86973,19 @@ class CacheConfig { for (const dir of cacheDirectories.trim().split(/\s+/).filter(Boolean)) { 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 = lib_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(external_path_default().join(target, "incremental")); } } } - const bins = await getCargoBins(); - self.cargoBins = Array.from(bins.values()); return self; } /** diff --git a/src/config.ts b/src/config.ts index 062e95e..b114c0d 100644 --- a/src/config.ts +++ b/src/config.ts @@ -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; } diff --git a/src/restore.ts b/src/restore.ts index 510a559..f7a59c9 100644 --- a/src/restore.ts +++ b/src/restore.ts @@ -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);