Files
orca/.github/workflows/unit-module-cache.yml
T
8b64ec281a ci: restore main's Vitest transform cache in PR unit shards (#34512)
* ci: restore main's Vitest transform cache in PR unit shards

Main produces per-shard transform caches on a schedule; PR shards restore
the newest one for the same config/lockfile/runtime policy. A Vitest cache
key generator folds each literal specifier's resolution candidates into the
per-module key so newly added files that shadow a resolution invalidate the
importer, and bails on glob-expanded dynamic imports.

* ci: list the resolution key plugin in the node tsconfig project

* ci: accept Vitest's CACHEDIR.TAG when sealing the unit module cache

Vitest 5.0.5 tags its cache root, which made every seal fail with
'invalid cache entry name' so no producer cache was ever saved.

* ci: reseed the unit module cache when any cache-key input lands on main

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-10-27 20:04:56 -07:00

51 lines
1.4 KiB
YAML

name: Unit transform cache producer
# Cold full unit run on main that publishes per-shard Vitest transform caches for PRs.
on:
schedule:
- cron: '17 */6 * * *'
workflow_dispatch:
push:
branches: [main]
# Cache-key inputs (see ci-unit-module-cache.mjs) change the key; reseed right away.
paths:
- '.github/workflows/unit-module-cache.yml'
- '.github/workflows/unit-tests.yml'
- 'config/vitest.config.ts'
- 'config/scripts/vitest*'
- 'config/scripts/ci-unit-module-cache*.mjs'
- 'config/patches/**'
- 'config/scripts/workspace-source-exports.mjs'
- 'config/dark-build-switches.cjs'
- 'config/pnpmfile.cjs'
- '.npmrc'
- '**/package.json'
- '**/tsconfig*.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- 'config/.bun-version'
concurrency:
group: unit-module-cache-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
unit_plan:
if: github.ref == 'refs/heads/main'
uses: ./.github/workflows/unit-plan.yml
test:
needs: unit_plan
uses: ./.github/workflows/unit-tests.yml
with:
# Match the PR unit matrix so the cache key's runtime and shard fields line up.
node_versions: '["24"]'
runner: blacksmith-8vcpu-ubuntu-2404
shards: ${{ needs.unit_plan.outputs.shards }}
module_cache: cold
artifact_prefix: cache-producer-unit
run_relay_integration: false