ci: parallelize core test configs

This commit is contained in:
Peter Steinberger
2026-04-23 09:42:07 +01:00
parent 7f64a3c4ca
commit 885bf1c5d8
3 changed files with 46 additions and 23 deletions

View File

@@ -1183,6 +1183,7 @@ jobs:
NODE_OPTIONS: --max-old-space-size=6144
OPENCLAW_NODE_TEST_CONFIGS_JSON: ${{ toJson(matrix.configs) }}
OPENCLAW_NODE_TEST_INCLUDE_PATTERNS_JSON: ${{ toJson(matrix.includePatterns) }}
OPENCLAW_TEST_PROJECTS_PARALLEL: "2"
shell: bash
run: |
set -euo pipefail
@@ -1190,7 +1191,6 @@ jobs:
import { spawnSync } from "node:child_process";
import { writeFileSync } from "node:fs";
import { join } from "node:path";
import { resolveVitestCliEntry, resolveVitestNodeArgs } from "./scripts/run-vitest.mjs";
const configs = JSON.parse(process.env.OPENCLAW_NODE_TEST_CONFIGS_JSON ?? "[]");
if (!Array.isArray(configs) || configs.length === 0) {
@@ -1208,27 +1208,12 @@ jobs:
childEnv.OPENCLAW_VITEST_INCLUDE_FILE = includeFile;
}
for (const config of configs) {
console.error(`[test] starting ${config}`);
const result = spawnSync(
"pnpm",
[
"exec",
"node",
...resolveVitestNodeArgs(process.env),
resolveVitestCliEntry(),
"run",
"--config",
config,
],
{
env: childEnv,
stdio: "inherit",
},
);
if ((result.status ?? 1) !== 0) {
process.exit(result.status ?? 1);
}
const result = spawnSync("pnpm", ["exec", "node", "scripts/test-projects.mjs", ...configs], {
env: childEnv,
stdio: "inherit",
});
if ((result.status ?? 1) !== 0) {
process.exit(result.status ?? 1);
}
EOF