Files
openclaw/.github/workflows/vitest-cache-warm.yml
T
Peter SteinbergerandGitHub 2ba272bda6 improve(ci): warm import-heavy Vitest graphs (#110557)
* perf(ci): broaden Vitest transform cache seed

* fix(ci): declare cache slot clone helper
2026-07-18 09:20:14 +01:00

88 lines
3.1 KiB
YAML

name: Vitest Cache Warm
on:
repository_dispatch:
types: [vitest-cache-warm]
schedule:
- cron: "17 8 * * *"
permissions:
contents: read
concurrency:
group: vitest-cache-warm
cancel-in-progress: false
jobs:
warm:
# Dependency snapshots are serialized before main CI fanout. This workflow
# writes only the transform and compile caches from scheduled/trusted runs.
if: github.repository == 'openclaw/openclaw'
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Setup Node environment
uses: ./.github/actions/setup-node-env
with:
install-bun: "false"
node-compile-cache: "true"
node-compile-cache-scope: "test"
save-actions-cache: "true"
save-node-compile-cache: "true"
save-vitest-fs-cache: "true"
sticky-disk: "false"
use-actions-cache: "true"
vitest-fs-cache: "true"
- name: Select broad cache seed
shell: bash
run: |
set -euo pipefail
node --input-type=module <<'EOF'
import { appendFileSync } from "node:fs";
import { createNodeTestShards } from "./scripts/lib/ci-node-test-plan.mjs";
// Warm whole configs for the striped unit-fast graph plus the import-
// bound graphs that remained cold in measured protected-cache readers.
const additionalShardNames = new Set([
"agentic-agents-embedded",
"agentic-gateway-methods",
"auto-reply-reply-commands-3",
]);
const allShards = createNodeTestShards();
const coreShards = allShards.filter((candidate) =>
candidate.shardName.startsWith("core-unit-fast"),
);
if (coreShards.length === 0) {
throw new Error("core-unit-fast cache seed shards are missing");
}
const additionalShards = allShards.filter((candidate) =>
additionalShardNames.has(candidate.shardName),
);
const foundAdditionalShardNames = new Set(
additionalShards.map((shard) => shard.shardName),
);
const missingShardNames = [...additionalShardNames].filter(
(name) => !foundAdditionalShardNames.has(name),
);
if (missingShardNames.length > 0) {
throw new Error(`cache seed shards are missing: ${missingShardNames.join(", ")}`);
}
const shards = [...coreShards, ...additionalShards];
const configs = [...new Set(shards.flatMap((shard) => shard.configs))];
appendFileSync(
process.env.GITHUB_ENV,
[
`OPENCLAW_NODE_TEST_CONFIGS_JSON=${JSON.stringify(configs)}`,
"OPENCLAW_VITEST_SHARD_NAME=core-unit-fast",
"OPENCLAW_NODE_TEST_PLAN_CONCURRENCY=1",
].join("\n") + "\n",
);
EOF
- name: Warm transform and compile caches
run: node scripts/ci-run-node-test-shard.mjs