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

[New Feature]: Distinguish architectures of caches #58

Merged
merged 1 commit into from
Jul 3, 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
4 changes: 2 additions & 2 deletions dist/setup-pdm.js
Original file line number Diff line number Diff line change
Expand Up @@ -91048,8 +91048,8 @@ var cache3 = __toESM(require_cache2());
var import_glob = __toESM(require_glob2());
async function calculateCacheKeys(pythonVersion, cacheDependencyPath) {
const hash = await (0, import_glob.hashFiles)(cacheDependencyPath);
const primaryKey = `setup-pdm-${import_node_process3.default.env.RUNNER_OS}-python-${pythonVersion}-${hash}`;
const restoreKey = `setup-pdm-${import_node_process3.default.env.RUNNER_OS}-python-${pythonVersion}-`;
const primaryKey = `setup-pdm-${import_node_process3.default.env.RUNNER_OS}-${import_node_process3.default.env.RUNNER_ARCH}-python-${pythonVersion}-${hash}`;
const restoreKey = `setup-pdm-${import_node_process3.default.env.RUNNER_OS}-${import_node_process3.default.env.RUNNER_ARCH}-python-${pythonVersion}-`;
return { primaryKey, restoreKeys: [restoreKey] };
}
async function cacheDependencies(pdmBin, pythonVersion) {
Expand Down
4 changes: 2 additions & 2 deletions src/caches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { getOutput } from './utils'

async function calculateCacheKeys(pythonVersion: string, cacheDependencyPath: string): Promise<{ primaryKey: string, restoreKeys: string[] }> {
const hash = await hashFiles(cacheDependencyPath)
const primaryKey = `setup-pdm-${process.env.RUNNER_OS}-python-${pythonVersion}-${hash}`
const restoreKey = `setup-pdm-${process.env.RUNNER_OS}-python-${pythonVersion}-`
const primaryKey = `setup-pdm-${process.env.RUNNER_OS}-${process.env.RUNNER_ARCH}-python-${pythonVersion}-${hash}`
const restoreKey = `setup-pdm-${process.env.RUNNER_OS}-${process.env.RUNNER_ARCH}-python-${pythonVersion}-`
return { primaryKey, restoreKeys: [restoreKey] }
}

Expand Down
Loading