Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions dist/index.js

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

9 changes: 6 additions & 3 deletions packages/setup-ocaml/src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
repositoryAddAll,
repositoryRemoveAll,
setupOpam,
update,
} from "./opam.js";
import { retrieveOpamLocalPackages } from "./packages.js";
import { setupCygwin } from "./windows.js";
Expand Down Expand Up @@ -69,12 +70,14 @@ export async function installer() {
core.addPath(CYGWIN_ROOT_BIN);
}
await setupOpam();
await repositoryRemoveAll();
await repositoryAddAll(OPAM_REPOSITORIES);
const ocamlCompiler = await RESOLVED_COMPILER;
if (!opamCacheHit) {
await repositoryRemoveAll();
await repositoryAddAll(OPAM_REPOSITORIES);
const ocamlCompiler = await RESOLVED_COMPILER;
await installOcaml(ocamlCompiler);
await saveOpamCache();
} else {
await update();
}
if (DUNE_CACHE) {
await restoreDuneCache();
Expand Down
6 changes: 6 additions & 0 deletions packages/setup-ocaml/src/opam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,9 @@ export async function repositoryRemoveAll() {
}
});
}

export async function update() {
await core.group("Update the list of available opam packages", async () => {
await exec("opam", ["update"]);
});
}