Skip to content

Commit 27b8ea9

Browse files
authored
Include CPU arch in the cache key (#228)
1 parent f0deed1 commit 27b8ea9

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

dist/restore/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86755,9 +86755,10 @@ class CacheConfig {
8675586755
key += `-${job}`;
8675686756
}
8675786757
}
86758-
// Add runner OS to the key to avoid cross-contamination of cache
86758+
// Add runner OS and CPU architecture to the key to avoid cross-contamination of cache
8675986759
const runnerOS = external_os_default().type();
86760-
key += `-${runnerOS}`;
86760+
const runnerArch = external_os_default().arch();
86761+
key += `-${runnerOS}-${runnerArch}`;
8676186762
self.keyPrefix = key;
8676286763
// Construct environment portion of the key:
8676386764
// This consists of a hash that considers the rust version

dist/save/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86755,9 +86755,10 @@ class CacheConfig {
8675586755
key += `-${job}`;
8675686756
}
8675786757
}
86758-
// Add runner OS to the key to avoid cross-contamination of cache
86758+
// Add runner OS and CPU architecture to the key to avoid cross-contamination of cache
8675986759
const runnerOS = external_os_default().type();
86760-
key += `-${runnerOS}`;
86760+
const runnerArch = external_os_default().arch();
86761+
key += `-${runnerOS}-${runnerArch}`;
8676186762
self.keyPrefix = key;
8676286763
// Construct environment portion of the key:
8676386764
// This consists of a hash that considers the rust version

src/config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ export class CacheConfig {
7474
}
7575
}
7676

77-
// Add runner OS to the key to avoid cross-contamination of cache
77+
// Add runner OS and CPU architecture to the key to avoid cross-contamination of cache
7878
const runnerOS = os.type();
79-
key += `-${runnerOS}`;
79+
const runnerArch = os.arch();
80+
key += `-${runnerOS}-${runnerArch}`;
8081

8182
self.keyPrefix = key;
8283

0 commit comments

Comments
 (0)