Skip to content

Commit

Permalink
fix: add arch to cached path
Browse files Browse the repository at this point in the history
  • Loading branch information
pengx17 authored Aug 29, 2023
1 parent 5e21ff4 commit 343cc68
Show file tree
Hide file tree
Showing 3 changed files with 2,288 additions and 2,282 deletions.
6 changes: 5 additions & 1 deletion __tests__/cache-restore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ describe('cache-restore', () => {
if (!process.env.RUNNER_OS) {
process.env.RUNNER_OS = 'Linux';
}
if (!process.env.RUNNER_ARCH) {
process.env.RUNNER_ARCH = 'X64';
}
const platform = process.env.RUNNER_OS;
const arch = process.env.RUNNER_ARCH;
const commonPath = '/some/random/path';
const npmCachePath = `${commonPath}/npm`;
const pnpmCachePath = `${commonPath}/pnpm`;
Expand Down Expand Up @@ -135,7 +139,7 @@ describe('cache-restore', () => {
await restoreCache(packageManager, '');
expect(hashFilesSpy).toHaveBeenCalled();
expect(infoSpy).toHaveBeenCalledWith(
`Cache restored from key: node-cache-${platform}-${packageManager}-${fileHash}`
`Cache restored from key: node-cache-${platform}-${arch}-${packageManager}-${fileHash}`
);
expect(infoSpy).not.toHaveBeenCalledWith(
`${packageManager} cache is not found`
Expand Down
Loading

0 comments on commit 343cc68

Please sign in to comment.