mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 15:30:47 +00:00
ci: speed up release validation
This commit is contained in:
@@ -809,6 +809,34 @@ const shouldUseExistingDistForGatewayClient = (deps, buildRequirement) =>
|
||||
deps.env.OPENCLAW_FORCE_BUILD !== "1" &&
|
||||
statMtime(deps.distEntry, deps.fs) != null;
|
||||
|
||||
const isQaParityReportCommand = (args) => args[0] === "qa" && args[1] === "parity-report";
|
||||
|
||||
const shouldRunQaParityReportFromSource = (deps, buildRequirement) =>
|
||||
buildRequirement.reason === "missing_private_qa_dist" &&
|
||||
isQaParityReportCommand(deps.args) &&
|
||||
deps.env.OPENCLAW_FORCE_BUILD !== "1" &&
|
||||
statMtime(path.join(deps.cwd, "extensions", "qa-lab", "src", "cli.runtime.ts"), deps.fs) != null;
|
||||
|
||||
const runQaParityReportFromSource = async (deps) => {
|
||||
const sourceEntrypoint = path.join(deps.cwd, "scripts", "qa-parity-report.ts");
|
||||
const nodeProcess = deps.spawn(
|
||||
deps.execPath,
|
||||
["--import", "tsx", sourceEntrypoint, ...deps.args.slice(2)],
|
||||
{
|
||||
cwd: deps.cwd,
|
||||
env: deps.env,
|
||||
stdio: deps.outputTee ? ["inherit", "pipe", "pipe"] : "inherit",
|
||||
},
|
||||
);
|
||||
pipeSpawnedOutput(nodeProcess, deps);
|
||||
const res = await waitForSpawnedProcess(nodeProcess, deps);
|
||||
const interruptedExitCode = getInterruptedSpawnExitCode(res);
|
||||
if (interruptedExitCode !== null) {
|
||||
return interruptedExitCode;
|
||||
}
|
||||
return res.exitCode ?? 1;
|
||||
};
|
||||
|
||||
export async function runNodeMain(params = {}) {
|
||||
const deps = {
|
||||
spawn: params.spawn ?? spawn,
|
||||
@@ -847,9 +875,15 @@ export async function runNodeMain(params = {}) {
|
||||
deps,
|
||||
buildRequirement,
|
||||
);
|
||||
const useQaParityReportSource = shouldRunQaParityReportFromSource(deps, buildRequirement);
|
||||
if (useExistingGatewayClientDist) {
|
||||
buildRequirement = { shouldBuild: false, reason: "gateway_client_existing_dist" };
|
||||
}
|
||||
if (useQaParityReportSource) {
|
||||
logRunner("Running QA parity report from source without rebuilding private QA dist.", deps);
|
||||
exitCode = await runQaParityReportFromSource(deps);
|
||||
return await closeRunNodeOutputTee(deps, exitCode);
|
||||
}
|
||||
if (!buildRequirement.shouldBuild) {
|
||||
if (!useExistingGatewayClientDist && !shouldSkipCleanWatchRuntimeSync(deps)) {
|
||||
const runtimePostBuildRequirement = resolveRuntimePostBuildRequirement(deps);
|
||||
|
||||
Reference in New Issue
Block a user