Skip to content

Commit

Permalink
fix: Add runner architecture to cache key (#37)
Browse files Browse the repository at this point in the history
This will prevent cache issues when switching platforms
  • Loading branch information
jahands authored Feb 20, 2024
1 parent f2bef5b commit b61ca41
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71275,7 +71275,8 @@ const restoreCache = (path, version) => __awaiter(void 0, void 0, void 0, functi
return false;
}
const platform = process.env.RUNNER_OS;
const primaryKey = `earthly-cache-${platform}-${version}`;
const arch = process.env.RUNNER_ARCH;
const primaryKey = `earthly-cache-${platform}-${arch}-${version}`;
core.debug(`primary key is ${primaryKey}`);
core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
core.saveState(constants_1.State.BinaryPath, path);
Expand Down
2 changes: 1 addition & 1 deletion dist/setup/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/cache-restore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ export const restoreCache = async (
}

const platform = process.env.RUNNER_OS;
const arch = process.env.RUNNER_ARCH;

const primaryKey = `earthly-cache-${platform}-${version}`;
const primaryKey = `earthly-cache-${platform}-${arch}-${version}`;
core.debug(`primary key is ${primaryKey}`);

core.saveState(State.CachePrimaryKey, primaryKey);
Expand Down

0 comments on commit b61ca41

Please sign in to comment.