Skip to content

Commit 3ef016c

Browse files
committed
opam env
Signed-off-by: Sora Morimoto <[email protected]>
1 parent 1c4e8e9 commit 3ef016c

File tree

11 files changed

+45
-34
lines changed

11 files changed

+45
-34
lines changed

dist/index.js

Lines changed: 18 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/post/index.js

Lines changed: 1 addition & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lint-doc/dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lint-fmt/dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lint-opam/dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/lint-doc/src/odoc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as process from "node:process";
22
import { exec } from "@actions/exec";
33

44
export async function lintOdoc() {
5-
const exitCode = await exec("opam", ["exec", "--", "dune", "build", "@doc"], {
5+
const exitCode = await exec("dune", ["build", "@doc"], {
66
env: {
77
...process.env,
88
PATH: process.env.PATH ?? "",

packages/lint-fmt/src/lint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { exec } from "@actions/exec";
22

33
export async function checkFmt() {
4-
await exec("opam", ["exec", "--", "dune", "build", "@fmt"]);
4+
await exec("dune", ["build", "@fmt"]);
55
}

packages/lint-opam/src/lint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ export async function opamLint() {
55
}
66

77
export async function opamDuneLint() {
8-
await exec("opam", ["exec", "--", "opam-dune-lint"]);
8+
await exec("opam-dune-lint");
99
}

packages/setup-ocaml/src/dune.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,7 @@ export async function trimDuneCache() {
2727
run_id,
2828
});
2929
const cacheSize = Math.floor(5000 / totalCount);
30-
await exec("opam", [
31-
"exec",
32-
"--",
33-
"dune",
34-
"cache",
35-
"trim",
36-
`--size=${cacheSize}MB`,
37-
]);
30+
await exec("dune", ["dune", "cache", "trim", `--size=${cacheSize}MB`]);
3831
},
3932
);
4033
}

packages/setup-ocaml/src/installer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
repositoryAddAll,
2525
repositoryRemoveAll,
2626
setupOpam,
27+
setupOpamEnv,
2728
} from "./opam.js";
2829
import { getOpamLocalPackages } from "./packages.js";
2930
import { resolveCompiler } from "./version.js";
@@ -71,20 +72,20 @@ export async function installer() {
7172
await installOcaml(ocamlCompiler);
7273
await saveOpamCache();
7374
}
75+
setupOpamEnv();
7476
if (DUNE_CACHE) {
7577
await restoreDuneCache();
7678
await installDune();
7779
core.exportVariable("DUNE_CACHE", "enabled");
7880
core.exportVariable("DUNE_CACHE_TRANSPORT", "direct");
7981
core.exportVariable("DUNE_CACHE_STORAGE_MODE", "copy");
8082
}
81-
core.exportVariable("CLICOLOR_FORCE", "1");
8283
const fnames = await getOpamLocalPackages();
8384
if (fnames.length > 0) {
8485
if (OPAM_PIN) {
8586
await pin(fnames);
8687
}
8788
}
8889
await exec("opam", ["--version"]);
89-
await exec("opam", ["exec", "--", "ocaml", "-version"]);
90+
await exec("ocaml", ["-version"]);
9091
}

0 commit comments

Comments
 (0)