From 8fa11751eaab94eaa5b8de8c1ecd143ef0066cd6 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Sun, 11 Oct 2026 18:16:04 +0800 Subject: [PATCH] ci: reuse portable build cache in native package jobs Transfer the build job Turbo cache to the four native package runners within the same workflow. Keep the normal build, prepack, pack, fresh installation, updater, and Inspector verification commands. Native artifacts and dependencies remain host-local. Validation: actionlint 1.7.7, check:ci and docs:check passed. A fresh independent checkout restored 1124 byte-identical files from 1.64 MB of compile/skills cache in 163 ms; a source change invalidated compile and skills entries. Full package and real Node Inspector verifiers passed on macOS arm64. Cross-platform CI timing remains to be measured. --- .github/workflows/ci.yml | 17 ++++++++++++++++- docs/testing.md | 6 ++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 131f46379..ccb36d5b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,6 +182,17 @@ jobs: if-no-files-found: error retention-days: 7 + # test:prepare caches only portable JS, skill, and catalog outputs. + # Native package jobs still run their build and prepack checks; Turbo + # restores matching outputs or rebuilds when their inputs differ. + - uses: actions/upload-artifact@v4 + with: + name: rea-build-cache + path: .turbo/cache/ + include-hidden-files: true + if-no-files-found: error + retention-days: 7 + test: name: Test (coverage + timing) needs: [changes, test-shard] @@ -298,7 +309,7 @@ jobs: package-e2e: name: Native package baseline (${{ matrix.platform }} ${{ matrix.architecture }}) - needs: [changes, windows-native-build] + needs: [changes, build, windows-native-build] if: needs.changes.outputs.runtime == 'true' strategy: fail-fast: false @@ -328,6 +339,10 @@ jobs: assert.equal(process.arch, process.env.EXPECTED_CI_ARCHITECTURE); console.log(JSON.stringify({ platform: process.platform, architecture: process.arch, node: process.version }));" - run: npm ci + - uses: actions/download-artifact@v4 + with: + name: rea-build-cache + path: .turbo/cache/ - uses: actions/download-artifact@v4 with: name: windows-native-controls diff --git a/docs/testing.md b/docs/testing.md index f249bbb04..59be84457 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -1015,6 +1015,12 @@ summary. Static checks, documentation, build, package verification, and real-system lanes remain separate jobs so one kind of evidence cannot stand in for another. +Native package jobs reuse the same workflow's Turbo cache for portable compiled +JavaScript, skills, and catalogs. They retain the normal build and prepack +commands, which restore matching outputs or rebuild on a cache miss. Native +artifacts, dependency installs, package archives, and runtime verification remain +host-local. Keep platform-dependent outputs out of this shared cache. + The PR acceptance target is a median `npm run check:pr` wall time below three minutes across three warm-build runs on the benchmark host. Keep Vitest caches cold unless separately identified. A PR that touches packaging or real-system