Skip to content

Commit

Permalink
_
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <[email protected]>
  • Loading branch information
smorimoto committed Jun 12, 2024
1 parent cd0384a commit 8beca9f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
10 changes: 5 additions & 5 deletions dist/index.js

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

9 changes: 4 additions & 5 deletions dist/post/index.js

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

9 changes: 4 additions & 5 deletions packages/setup-ocaml/src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import {
ARCHITECTURE,
CACHE_PREFIX,
CYGWIN_MIRROR,
GITHUB_WORKSPACE,
OCAML_COMPILER,
OPAM_DISABLE_SANDBOXING,
OPAM_ROOT_UNIX,
OPAM_ROOT_WINDOWS,
OPAM_SWITCH,
PLATFORM,
} from "./constants.js";
import { getLatestOpamRelease } from "./opam.js";
Expand Down Expand Up @@ -75,13 +77,12 @@ async function composeOpamCacheKeys() {

function composeCygwinCachePaths() {
const paths = [];
const githubWorkspace = process.env.GITHUB_WORKSPACE ?? process.cwd();
const cygwinRoot = path.join("D:", "cygwin");
paths.push(cygwinRoot);
const cygwinRootSymlinkPath = path.posix.join("/cygdrive", "d", "cygwin");
paths.push(cygwinRootSymlinkPath);
const cygwinEncodedUri = encodeURIComponent(CYGWIN_MIRROR).toLowerCase();
const cygwinPackageRoot = path.join(githubWorkspace, cygwinEncodedUri);
const cygwinPackageRoot = path.join(GITHUB_WORKSPACE, cygwinEncodedUri);
paths.push(cygwinPackageRoot);
return paths;
}
Expand Down Expand Up @@ -121,9 +122,7 @@ function composeOpamCachePaths() {
} else {
paths.push(OPAM_ROOT_UNIX);
}
const githubWorkspace = process.env.GITHUB_WORKSPACE ?? process.cwd();
const opamLocalCachePath = path.join(githubWorkspace, "_opam");
paths.push(opamLocalCachePath);
paths.push(OPAM_SWITCH);
return paths;
}

Expand Down
4 changes: 4 additions & 0 deletions packages/setup-ocaml/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ export const CYGWIN_MIRROR = "https://cygwin.mirror.constant.com/";

export const CYGWIN_ROOT = path.join("D:", "cygwin");

export const GITHUB_WORKSPACE = process.env.GITHUB_WORKSPACE ?? process.cwd();

export const OPAM_ROOT_UNIX = path.join(os.homedir(), ".opam");

export const OPAM_ROOT_WINDOWS = path.join("D:", ".opam");

export const OPAM_SWITCH = path.join(GITHUB_WORKSPACE, "_opam");

export const ALLOW_PRERELEASE_OPAM = core.getBooleanInput(
"allow-prerelease-opam",
{
Expand Down
2 changes: 2 additions & 0 deletions packages/setup-ocaml/src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
OPAM_REPOSITORIES,
OPAM_ROOT_UNIX,
OPAM_ROOT_WINDOWS,
OPAM_SWITCH,
PLATFORM,
} from "./constants.js";
import { installDune } from "./dune.js";
Expand All @@ -40,6 +41,7 @@ export async function installer() {
core.exportVariable("OPAMERRLOGLEN", 0);
core.exportVariable("OPAMPRECISETRACKING", 1);
core.exportVariable("OPAMROOT", OPAM_ROOT_UNIX);
core.exportVariable("OPAMSWITCH", OPAM_SWITCH);
core.exportVariable("OPAMYES", 1);
if (PLATFORM === "windows") {
core.exportVariable("CYGWIN", "winsymlinks:native");
Expand Down

0 comments on commit 8beca9f

Please sign in to comment.