Skip to content

Commit 343cc68

Browse files
authored
fix: add arch to cached path
1 parent 5e21ff4 commit 343cc68

File tree

3 files changed

+2288
-2282
lines changed

3 files changed

+2288
-2282
lines changed

__tests__/cache-restore.test.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ describe('cache-restore', () => {
1111
if (!process.env.RUNNER_OS) {
1212
process.env.RUNNER_OS = 'Linux';
1313
}
14+
if (!process.env.RUNNER_ARCH) {
15+
process.env.RUNNER_ARCH = 'X64';
16+
}
1417
const platform = process.env.RUNNER_OS;
18+
const arch = process.env.RUNNER_ARCH;
1519
const commonPath = '/some/random/path';
1620
const npmCachePath = `${commonPath}/npm`;
1721
const pnpmCachePath = `${commonPath}/pnpm`;
@@ -135,7 +139,7 @@ describe('cache-restore', () => {
135139
await restoreCache(packageManager, '');
136140
expect(hashFilesSpy).toHaveBeenCalled();
137141
expect(infoSpy).toHaveBeenCalledWith(
138-
`Cache restored from key: node-cache-${platform}-${packageManager}-${fileHash}`
142+
`Cache restored from key: node-cache-${platform}-${arch}-${packageManager}-${fileHash}`
139143
);
140144
expect(infoSpy).not.toHaveBeenCalledWith(
141145
`${packageManager} cache is not found`

0 commit comments

Comments
 (0)