5
0
mirror of https://github.com/astral-sh/setup-uv.git synced 2025-12-19 11:04:08 +00:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Kevin Stillhammer
180f8b4439 Fix wrong cacheDependencyPathHash (#201)
Introduced in https://github.com/astral-sh/setup-uv/pull/200 and not
caught because the test is not needed for automerge to pass
2024-12-20 11:42:38 +01:00
Kevin Stillhammer
e3fb95a689 Warn instead of fail for no-dependency-glob (#200)
Closes: #199
2024-12-20 10:32:52 +00:00
3 changed files with 11 additions and 10 deletions

6
dist/save-cache/index.js generated vendored
View File

@@ -91490,11 +91490,11 @@ function computeKeys(version) {
core.info(`Searching files using cache dependency glob: ${inputs_1.cacheDependencyGlob.split("\n").join(",")}`); core.info(`Searching files using cache dependency glob: ${inputs_1.cacheDependencyGlob.split("\n").join(",")}`);
cacheDependencyPathHash += yield (0, hash_files_1.hashFiles)(inputs_1.cacheDependencyGlob, true); cacheDependencyPathHash += yield (0, hash_files_1.hashFiles)(inputs_1.cacheDependencyGlob, true);
if (cacheDependencyPathHash === "-") { if (cacheDependencyPathHash === "-") {
throw new Error(`No file matched to [${inputs_1.cacheDependencyGlob.split("\n").join(",")}], make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`); core.warning(`No file matched to [${inputs_1.cacheDependencyGlob.split("\n").join(",")}]. The cache will never get invalidated. Make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`);
} }
} }
else { if (cacheDependencyPathHash === "-") {
cacheDependencyPathHash += "no-dependency-glob"; cacheDependencyPathHash = "-no-dependency-glob";
} }
const suffix = inputs_1.cacheSuffix ? `-${inputs_1.cacheSuffix}` : ""; const suffix = inputs_1.cacheSuffix ? `-${inputs_1.cacheSuffix}` : "";
const pythonVersion = yield getPythonVersion(); const pythonVersion = yield getPythonVersion();

6
dist/setup/index.js generated vendored
View File

@@ -96573,11 +96573,11 @@ function computeKeys(version) {
core.info(`Searching files using cache dependency glob: ${inputs_1.cacheDependencyGlob.split("\n").join(",")}`); core.info(`Searching files using cache dependency glob: ${inputs_1.cacheDependencyGlob.split("\n").join(",")}`);
cacheDependencyPathHash += yield (0, hash_files_1.hashFiles)(inputs_1.cacheDependencyGlob, true); cacheDependencyPathHash += yield (0, hash_files_1.hashFiles)(inputs_1.cacheDependencyGlob, true);
if (cacheDependencyPathHash === "-") { if (cacheDependencyPathHash === "-") {
throw new Error(`No file matched to [${inputs_1.cacheDependencyGlob.split("\n").join(",")}], make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`); core.warning(`No file matched to [${inputs_1.cacheDependencyGlob.split("\n").join(",")}]. The cache will never get invalidated. Make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`);
} }
} }
else { if (cacheDependencyPathHash === "-") {
cacheDependencyPathHash += "no-dependency-glob"; cacheDependencyPathHash = "-no-dependency-glob";
} }
const suffix = inputs_1.cacheSuffix ? `-${inputs_1.cacheSuffix}` : ""; const suffix = inputs_1.cacheSuffix ? `-${inputs_1.cacheSuffix}` : "";
const pythonVersion = yield getPythonVersion(); const pythonVersion = yield getPythonVersion();

View File

@@ -43,12 +43,13 @@ async function computeKeys(version: string): Promise<string> {
); );
cacheDependencyPathHash += await hashFiles(cacheDependencyGlob, true); cacheDependencyPathHash += await hashFiles(cacheDependencyGlob, true);
if (cacheDependencyPathHash === "-") { if (cacheDependencyPathHash === "-") {
throw new Error( core.warning(
`No file matched to [${cacheDependencyGlob.split("\n").join(",")}], make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`, `No file matched to [${cacheDependencyGlob.split("\n").join(",")}]. The cache will never get invalidated. Make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`,
); );
} }
} else { }
cacheDependencyPathHash += "no-dependency-glob"; if (cacheDependencyPathHash === "-") {
cacheDependencyPathHash = "-no-dependency-glob";
} }
const suffix = cacheSuffix ? `-${cacheSuffix}` : ""; const suffix = cacheSuffix ? `-${cacheSuffix}` : "";
const pythonVersion = await getPythonVersion(); const pythonVersion = await getPythonVersion();