Skip to content

Commit

Permalink
Use separate opam cache for msys2 installs
Browse files Browse the repository at this point in the history
  • Loading branch information
tobil4sk committed Sep 5, 2024
1 parent 210ca9a commit 27a0374
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion dist/post/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion packages/setup-ocaml/src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ async function composeOpamCacheKeys() {
const ocamlCompiler = await RESOLVED_COMPILER;
const repositoryUrls = OPAM_REPOSITORIES.map(([_, value]) => value).join(",");
const osInfo = await system.osInfo();
const msys2 = WINDOWS_ENVIRONMENT === "msys2" ? "msys2" : undefined;
const plainKey = [
PLATFORM,
osInfo.release,
Expand All @@ -58,7 +59,9 @@ async function composeOpamCacheKeys() {
ocamlCompiler,
repositoryUrls,
sandbox,
].join(",");
]
.concat(msys2 ?? [])
.join(",");
const hash = crypto.createHash("sha256").update(plainKey).digest("hex");
const key = `${CACHE_PREFIX}-setup-ocaml-opam-${hash}`;
const restoreKeys = [key];
Expand Down

0 comments on commit 27a0374

Please sign in to comment.