mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-02-08 18:47:26 +00:00
Add prune-cache input to cache key
This commit is contained in:
parent
703e0144d0
commit
a7388fa322
3 changed files with 7 additions and 3 deletions
3
dist/save-cache/index.js
generated
vendored
3
dist/save-cache/index.js
generated
vendored
|
|
@ -88715,7 +88715,8 @@ async function computeKeys() {
|
|||
const suffix = inputs_1.cacheSuffix ? `-${inputs_1.cacheSuffix}` : "";
|
||||
const pythonVersion = await getPythonVersion();
|
||||
const platform = await (0, platforms_1.getPlatform)();
|
||||
return `setup-uv-${CACHE_VERSION}-${(0, platforms_1.getArch)()}-${platform}-${pythonVersion}${cacheDependencyPathHash}${suffix}`;
|
||||
const pruned = inputs_1.pruneCache ? "-pruned" : "";
|
||||
return `setup-uv-${CACHE_VERSION}-${(0, platforms_1.getArch)()}-${platform}-${pythonVersion}${pruned}${cacheDependencyPathHash}${suffix}`;
|
||||
}
|
||||
async function getPythonVersion() {
|
||||
if (inputs_1.pythonVersion !== "") {
|
||||
|
|
|
|||
3
dist/setup/index.js
generated
vendored
3
dist/setup/index.js
generated
vendored
|
|
@ -121046,7 +121046,8 @@ async function computeKeys() {
|
|||
const suffix = inputs_1.cacheSuffix ? `-${inputs_1.cacheSuffix}` : "";
|
||||
const pythonVersion = await getPythonVersion();
|
||||
const platform = await (0, platforms_1.getPlatform)();
|
||||
return `setup-uv-${CACHE_VERSION}-${(0, platforms_1.getArch)()}-${platform}-${pythonVersion}${cacheDependencyPathHash}${suffix}`;
|
||||
const pruned = inputs_1.pruneCache ? "-pruned" : "";
|
||||
return `setup-uv-${CACHE_VERSION}-${(0, platforms_1.getArch)()}-${platform}-${pythonVersion}${pruned}${cacheDependencyPathHash}${suffix}`;
|
||||
}
|
||||
async function getPythonVersion() {
|
||||
if (inputs_1.pythonVersion !== "") {
|
||||
|
|
|
|||
4
src/cache/restore-cache.ts
vendored
4
src/cache/restore-cache.ts
vendored
|
|
@ -4,6 +4,7 @@ import {
|
|||
cacheDependencyGlob,
|
||||
cacheLocalPath,
|
||||
cacheSuffix,
|
||||
pruneCache,
|
||||
pythonVersion as pythonVersionInput,
|
||||
workingDirectory,
|
||||
} from "../utils/inputs";
|
||||
|
|
@ -55,7 +56,8 @@ async function computeKeys(): Promise<string> {
|
|||
const suffix = cacheSuffix ? `-${cacheSuffix}` : "";
|
||||
const pythonVersion = await getPythonVersion();
|
||||
const platform = await getPlatform();
|
||||
return `setup-uv-${CACHE_VERSION}-${getArch()}-${platform}-${pythonVersion}${cacheDependencyPathHash}${suffix}`;
|
||||
const pruned = pruneCache ? "-pruned" : "";
|
||||
return `setup-uv-${CACHE_VERSION}-${getArch()}-${platform}-${pythonVersion}${pruned}${cacheDependencyPathHash}${suffix}`;
|
||||
}
|
||||
|
||||
async function getPythonVersion(): Promise<string> {
|
||||
|
|
|
|||
Loading…
Reference in a new issue