mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-02-21 00:01:46 +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 suffix = inputs_1.cacheSuffix ? `-${inputs_1.cacheSuffix}` : "";
|
||||||
const pythonVersion = await getPythonVersion();
|
const pythonVersion = await getPythonVersion();
|
||||||
const platform = await (0, platforms_1.getPlatform)();
|
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() {
|
async function getPythonVersion() {
|
||||||
if (inputs_1.pythonVersion !== "") {
|
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 suffix = inputs_1.cacheSuffix ? `-${inputs_1.cacheSuffix}` : "";
|
||||||
const pythonVersion = await getPythonVersion();
|
const pythonVersion = await getPythonVersion();
|
||||||
const platform = await (0, platforms_1.getPlatform)();
|
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() {
|
async function getPythonVersion() {
|
||||||
if (inputs_1.pythonVersion !== "") {
|
if (inputs_1.pythonVersion !== "") {
|
||||||
|
|
|
||||||
4
src/cache/restore-cache.ts
vendored
4
src/cache/restore-cache.ts
vendored
|
|
@ -4,6 +4,7 @@ import {
|
||||||
cacheDependencyGlob,
|
cacheDependencyGlob,
|
||||||
cacheLocalPath,
|
cacheLocalPath,
|
||||||
cacheSuffix,
|
cacheSuffix,
|
||||||
|
pruneCache,
|
||||||
pythonVersion as pythonVersionInput,
|
pythonVersion as pythonVersionInput,
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
} from "../utils/inputs";
|
} from "../utils/inputs";
|
||||||
|
|
@ -55,7 +56,8 @@ async function computeKeys(): Promise<string> {
|
||||||
const suffix = cacheSuffix ? `-${cacheSuffix}` : "";
|
const suffix = cacheSuffix ? `-${cacheSuffix}` : "";
|
||||||
const pythonVersion = await getPythonVersion();
|
const pythonVersion = await getPythonVersion();
|
||||||
const platform = await getPlatform();
|
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> {
|
async function getPythonVersion(): Promise<string> {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue