Stage only the current portable Turbo task archives, metadata and available manifests for same-run artifact consumers. Share task identity/hash validation with cross-run keys and fail publication on incomplete preparation, while retaining existing cache authority and consumer build/prepack verification. Validation: 252 focused tests, full check:ci, docs:check, check:fast, actionlint, real Turbo output equivalence and invalidation, restored CLI/MCP scenarios and full Linux package verification passed. Fault injection detected historical-entry inclusion. Exact-head hosted CI and available review passed; measurement limits are recorded in the PR. Refs #4744.
42 lines
1.7 KiB
YAML
42 lines
1.7 KiB
YAML
name: Portable build cache
|
|
description: Restore portable Turbo build outputs from the current run or cross-run cache.
|
|
inputs:
|
|
save:
|
|
description: Save newly built outputs after the job succeeds.
|
|
default: "false"
|
|
build_cache_artifact:
|
|
description: Reuse portable Turbo outputs uploaded by the current workflow run.
|
|
default: ""
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Download portable build outputs from this workflow run
|
|
if: inputs.build_cache_artifact != ''
|
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
|
with:
|
|
name: ${{ inputs.build_cache_artifact }}
|
|
path: .turbo/cache/
|
|
- name: Resolve portable build task hashes
|
|
id: plan
|
|
if: inputs.build_cache_artifact == ''
|
|
shell: bash
|
|
env:
|
|
BUILD_CACHE_PREFIX: rea-portable-build-v2-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.npmrc', '.nvmrc', 'package-lock.json') }}
|
|
run: |
|
|
npm run --silent test:prepare -- --dry=json |
|
|
node scripts/ci/portable-build-cache.mjs key >> "$GITHUB_OUTPUT"
|
|
- name: Restore portable build outputs
|
|
if: inputs.build_cache_artifact == '' && inputs.save != 'true'
|
|
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
|
with:
|
|
path: .turbo/cache/
|
|
key: ${{ steps.plan.outputs.key }}
|
|
restore-keys: ${{ steps.plan.outputs.prefix }}
|
|
- name: Restore and save portable build outputs
|
|
if: inputs.build_cache_artifact == '' && inputs.save == 'true'
|
|
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
|
with:
|
|
path: .turbo/cache/
|
|
key: ${{ steps.plan.outputs.key }}
|
|
restore-keys: ${{ steps.plan.outputs.prefix }}
|