ci: Add bootstrap.ps1 and automate Windows build images (#15466)

Co-authored-by: Electroid <Electroid@users.noreply.github.com>
This commit is contained in:
Ashcon Partovi
2024-12-04 16:33:00 -08:00
committed by GitHub
parent 55a0bdc68d
commit e904a181d8
13 changed files with 3750 additions and 1248 deletions

View File

@@ -3,6 +3,7 @@
import { spawn as nodeSpawn } from "node:child_process";
import { existsSync, readFileSync, mkdirSync, cpSync, chmodSync } from "node:fs";
import { basename, join, resolve } from "node:path";
import { isCI, printEnvironment, startGroup } from "./utils.mjs";
// https://cmake.org/cmake/help/latest/manual/cmake.1.html#generate-a-project-buildsystem
const generateFlags = [
@@ -37,6 +38,10 @@ async function build(args) {
return spawn("pwsh", ["-NoProfile", "-NoLogo", "-File", shellPath, process.argv0, scriptPath, ...args]);
}
if (isCI) {
printEnvironment();
}
const env = {
...process.env,
FORCE_COLOR: "1",
@@ -102,7 +107,8 @@ async function build(args) {
const generateArgs = Object.entries(generateOptions).flatMap(([flag, value]) =>
flag.startsWith("-D") ? [`${flag}=${value}`] : [flag, value],
);
await spawn("cmake", generateArgs, { env }, "configuration");
await startGroup("CMake Configure", () => spawn("cmake", generateArgs, { env }));
const envPath = resolve(buildPath, ".env");
if (existsSync(envPath)) {
@@ -116,7 +122,8 @@ async function build(args) {
const buildArgs = Object.entries(buildOptions)
.sort(([a], [b]) => (a === "--build" ? -1 : a.localeCompare(b)))
.flatMap(([flag, value]) => [flag, value]);
await spawn("cmake", buildArgs, { env }, "compilation");
await startGroup("CMake Build", () => spawn("cmake", buildArgs, { env }));
printDuration("total", Date.now() - startTime);
}