Files
openclaw/.github/workflows/vitest-cache-warm.yml
Peter Steinberger b78cf56349 improve(ci): persist warm Vitest and Node caches (#109425)
* perf(ci): harden persistent test caches

* ci: document trusted cache cleanup trigger

* ci: harden composite cache inputs

* perf(ci): isolate Node build bytecode cache
2026-07-16 17:22:28 -07:00

62 lines
1.8 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:
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"
runtime-cache-sticky-disk: "true"
save-node-compile-cache: "true"
save-vitest-fs-cache: "true"
sticky-disk: "true"
use-actions-cache: "false"
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";
const shard = createNodeTestShards().find((candidate) => candidate.shardName === "core-unit-fast");
if (!shard) {
throw new Error("core-unit-fast cache seed shard is missing");
}
appendFileSync(
process.env.GITHUB_ENV,
[
`OPENCLAW_NODE_TEST_CONFIGS_JSON=${JSON.stringify(shard.configs)}`,
`OPENCLAW_VITEST_SHARD_NAME=${shard.shardName}`,
"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