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
15 changes: 10 additions & 5 deletions dist/index.cjs

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

15 changes: 10 additions & 5 deletions packages/setup-ocaml/src/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,25 @@ export async function getCygwinVersion() {
const response = await httpClient.get("https://www.cygwin.com");
const body = await response.readBody();
const $ = cheerio.load(body);
let version = "";
let version = null;
$("a").each((_index, element) => {
const text = $(element).text();
if (semver.valid(text) === text) {
version = text;
}
});
return version;
if (version !== null) {
return version;
} else {
core.info("Cygwin homepage:");
core.info(body);
throw new Error("Couldn't parse Cygwin version from homepage");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: is there a way to inspect errors like in CI in datadog? just interested in case we want to look up how many times this has come up.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could start sending CI logs to Datadog, but I think that's expensive. We can at least monitor how often the setup-ocaml step specifically fails.

}
}

export async function setupCygwin() {
await core.group("Setting up Cygwin environment", async () => {
const version = await getCygwinVersion();
const cachedPath = toolCache.find("cygwin", version, "x86_64");
const cachedPath = toolCache.find("cygwin", "latest", "x86_64");
if (cachedPath === "") {
const downloadedPath = await toolCache.downloadTool(
"https://cygwin.com/setup-x86_64.exe",
Expand All @@ -48,7 +53,7 @@ export async function setupCygwin() {
downloadedPath,
"setup-x86_64.exe",
"cygwin",
version,
"latest",
"x86_64",
);
core.addPath(cachedPath);
Expand Down
Loading