From a2f944aafdf651c04011b336d4861477a66861c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9D=A4=E6=98=AF=E7=BA=B1=E9=9B=BE=E9=85=B1=E5=93=9F?= =?UTF-8?q?=EF=BD=9E?= <49941141+Dragon1573@users.noreply.github.com> Date: Wed, 3 Jul 2024 01:29:24 +0800 Subject: [PATCH] [New Feature]: Distinguish architectures of caches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> --- dist/setup-pdm.js | 4 ++-- src/caches.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/setup-pdm.js b/dist/setup-pdm.js index 178f70d..6e54665 100644 --- a/dist/setup-pdm.js +++ b/dist/setup-pdm.js @@ -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) { diff --git a/src/caches.ts b/src/caches.ts index 690b26a..fc3b666 100644 --- a/src/caches.ts +++ b/src/caches.ts @@ -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] } }