Skip to content

Commit d22146e

Browse files
vincentkocsteipete
andauthored
perf(ci): partition Mac tests and admit long jobs first (#134847)
Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
1 parent 63c53d7 commit d22146e

20 files changed

Lines changed: 1320 additions & 1101 deletions

‎.agents/skills/openclaw-ci-limits/SKILL.md‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ availability, Blacksmith control-plane health, and downstream queue drains.
3131

3232
## Rejected Experiments
3333

34+
- **Hosted Mac exact dependencies (2026-09-01):** The same-head publisher and
35+
consumer in [run 33458856298](https://github.com/openclaw/openclaw/actions/runs/33458856298)
36+
successfully saved and restored a 1.66-GB dependency archive, but setup took
37+
142s versus 86s with the ordinary store cache. Extraction took 82s versus 27s;
38+
install improved only from 43s to 35s. Keep hosted Mac jobs on the ordinary
39+
store cache. Reconsider only with measured total setup savings, including
40+
transfer, extraction and frozen reconciliation, not a successful cache hit.
3441
- **Actions-artifact checkout (2026-08-16):** Do not recommend replacing the
3542
shared Blacksmith Git fetch with a preflight-produced workspace or `.git`
3643
artifact. [PR #124818](https://github.com/openclaw/openclaw/pull/124818)
@@ -177,8 +184,8 @@ These are intentionally guarded by `test/scripts/ci-workflow-guards.test.ts`:
177184
or standalone admission job. The protected `vitest-cache-warm` workflow
178185
publishes the immutable semantic dependency archive after setup succeeds,
179186
before build and transform warming. Preflight and downstream Node jobs are
180-
restore-only consumers on eligible self-hosted runners; exact misses and
181-
hosted/fork/manual paths use the ordinary pnpm-store cache.
187+
restore-only consumers on eligible self-hosted runners. Exact misses and
188+
hosted paths, including Mac Node jobs, use the ordinary pnpm-store cache.
182189
- Hybrid first attempts route `preflight`, `security-fast`, and `ci-gate` to
183190
the existing 4-vCPU Blacksmith runner after measured hosted queue delays.
184191
Contributor trust, manual/non-canonical fallbacks, hosted retries, and the
@@ -199,6 +206,11 @@ These are intentionally guarded by `test/scripts/ci-workflow-guards.test.ts`:
199206
full-suite plan. Targeted plans retain the full built-artifact
200207
boundary gate. `main` uses compact integration; manual and release runs use
201208
full named shards.
209+
- The combined Node matrix admits compact and plugin descriptors by estimated
210+
duration within the same cap. Catch-all, QA and provider configs use the
211+
existing 90-file job budget with native Vitest sharding; retain complete
212+
config discovery, exclusions and process isolation. Count every appended
213+
plugin row, including the five added QA/provider rows, in the burst envelope.
202214
- `build-artifacts` on `blacksmith-32vcpu-ubuntu-2404`.
203215
- lower-weight Node/check shards on `blacksmith-4vcpu-ubuntu-2404`.
204216
- heavy retained Linux/Android shards on `blacksmith-8vcpu-ubuntu-2404`.

‎.github/workflows/ci.yml‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,10 @@ jobs:
13711371
...changedExtensionFallbackShards,
13721372
]
13731373
: [];
1374-
const nodeTestShards = rawNodeTestShards.map((shard) => ({
1374+
// The same capped matrix owns compact and plugin work; admit its longest rows first.
1375+
const nodeTestShards = rawNodeTestShards
1376+
.toSorted((a, b) => (b.predictedSeconds ?? 0) - (a.predictedSeconds ?? 0))
1377+
.map((shard) => ({
13751378
check_name: shard.checkName,
13761379
runtime: "node",
13771380
task: "test-shard",
@@ -1500,7 +1503,16 @@ jobs:
15001503
),
15011504
run_macos_node: runMacosNode,
15021505
macos_node_matrix: createMatrix(
1503-
runMacosNode ? [{ check_name: "macos-node", runtime: "node", task: "test" }] : [],
1506+
runMacosNode
1507+
? [1, 2, 3].every((part) => hasPackageScript(`test:macos:ci:${part}`))
1508+
? [1, 2, 3].map((part) => ({
1509+
check_name: `macos-node-${part}`,
1510+
runtime: "node",
1511+
task: `test-${part}`,
1512+
}))
1513+
// Historical targets keep their complete native suite in one job.
1514+
: [{ check_name: "macos-node", runtime: "node", task: "test" }]
1515+
: [],
15041516
),
15051517
run_macos_swift:
15061518
runMacos && (!frozenTarget || compatibilityTarget || supportsCurrentMacosSwiftCi),
@@ -2107,8 +2119,8 @@ jobs:
21072119
wait_checks
21082120
fi
21092121
2110-
# The dedicated Node shard owns the full built-CLI PTY suite. Keep
2111-
# only the local roundtrip and Gateway-connect artifact canaries here.
2122+
# These canaries verify the built CLI's local roundtrip and Gateway connection.
2123+
# Full plans retain the PTY descriptor, but CI consumes it only as this selection flag.
21122124
if [ "$RUN_TUI_PTY" = "true" ]; then
21132125
start_check "tui-pty" env \
21142126
NODE_OPTIONS=--max-old-space-size=8192 \
@@ -4053,6 +4065,7 @@ jobs:
40534065
timeout-minutes: 20
40544066
strategy:
40554067
fail-fast: false
4068+
max-parallel: 3
40564069
matrix: ${{ fromJson(needs.preflight.outputs.macos_node_matrix) }}
40574070
steps:
40584071
- *platform_checkout_step
@@ -4073,6 +4086,9 @@ jobs:
40734086
set -euo pipefail
40744087
node -e 'const os = require("node:os"); console.log("Native OS resources: " + JSON.stringify({ logicalCpuCount: os.cpus().length, availableParallelism: os.availableParallelism(), osTotalMemoryBytes: os.totalmem(), osFreeMemoryBytes: os.freemem() }));'
40754088
case "$TASK" in
4089+
test-[123])
4090+
pnpm "test:macos:ci:${TASK#test-}"
4091+
;;
40764092
test)
40774093
# Linux owns the full repo test suite. Keep macOS CI focused on
40784094
# launchd/Homebrew/runtime path coverage and the process-group wrapper.

0 commit comments

Comments
 (0)