Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove uv version from cache key #206

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dist/save-cache/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions dist/setup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/cache/restore-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export const STATE_CACHE_KEY = "cache-key";
export const STATE_CACHE_MATCHED_KEY = "cache-matched-key";
const CACHE_VERSION = "1";

export async function restoreCache(version: string): Promise<void> {
const cacheKey = await computeKeys(version);
export async function restoreCache(): Promise<void> {
const cacheKey = await computeKeys();

let matchedKey: string | undefined;
core.info(
Expand All @@ -35,7 +35,7 @@ export async function restoreCache(version: string): Promise<void> {
handleMatchResult(matchedKey, cacheKey);
}

async function computeKeys(version: string): Promise<string> {
async function computeKeys(): Promise<string> {
let cacheDependencyPathHash = "-";
if (cacheDependencyGlob !== "") {
core.info(
Expand All @@ -53,7 +53,7 @@ async function computeKeys(version: string): Promise<string> {
}
const suffix = cacheSuffix ? `-${cacheSuffix}` : "";
const pythonVersion = await getPythonVersion();
return `setup-uv-${CACHE_VERSION}-${getArch()}-${getPlatform()}-${version}-${pythonVersion}${cacheDependencyPathHash}${suffix}`;
return `setup-uv-${CACHE_VERSION}-${getArch()}-${getPlatform()}-${pythonVersion}${cacheDependencyPathHash}${suffix}`;
}

async function getPythonVersion(): Promise<string> {
Expand Down
2 changes: 1 addition & 1 deletion src/setup-uv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function run(): Promise<void> {
core.info(`Successfully installed uv version ${setupResult.version}`);

if (enableCache) {
await restoreCache(setupResult.version);
await restoreCache();
}
process.exit(0);
} catch (err) {
Expand Down
Loading