From ce8eca5edf1ba57b25676ee97e834912214fe9db Mon Sep 17 00:00:00 2001 From: M4n5ter Date: Mon, 31 Aug 2026 15:45:11 +0800 Subject: [PATCH 1/4] ci: cache Rust builds with Kache --- .github/workflows/ci.yml | 41 ++++++++++++++++++- .github/workflows/cli-package-validation.yml | 34 ++++++++++++++- .../workflows/gitoxide-helper-admission.yml | 30 ++++++++++++++ .../workflows/runtime-host-peer-admission.yml | 32 ++++++++++++++- .github/workflows/windows-sandbox-w0.yml | 30 ++++++++++++++ 5 files changed, 163 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53b88315a6..4797eced06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -285,9 +285,36 @@ jobs: if: steps.plan.outputs.cli_package == 'true' run: rustup update stable --no-self-update + - id: cli-rustc + name: Resolve CLI Rust cache version + if: steps.plan.outputs.cli_package == 'true' + shell: bash + run: | + echo "version=$(rustc --version | cut -d ' ' -f 2)" >> "$GITHUB_OUTPUT" + { + echo "KACHE_CACHE_DIR=${{ runner.temp }}/kache-cli-package" + echo "KACHE_RUNTIME_DIR=${{ runner.temp }}/kache-cli-package-runtime" + echo "RUSTC_WRAPPER=kache" + } >> "$GITHUB_ENV" + + - name: Install Kache for CLI packaging + if: steps.plan.outputs.cli_package == 'true' + uses: taiki-e/install-action@1ed6d7be6168f6c9046541087ff549b6bc581fdf # v2 + with: + tool: kache@0.16.0 + + - id: cli-kache-cache + name: Restore CLI Rust build cache + if: steps.plan.outputs.cli_package == 'true' + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ runner.temp }}/kache-cli-package + key: kache-runtime-host-peer-cli-package-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.cli-rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }} + restore-keys: kache-runtime-host-peer-cli-package-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.cli-rustc.outputs.version }}- + - name: Install cargo-deny for CLI packaging if: steps.plan.outputs.cli_package == 'true' - uses: taiki-e/install-action@fcf5432d9f50d67e37ee6e29bdb7a224ff67b4a7 # v2 + uses: taiki-e/install-action@1ed6d7be6168f6c9046541087ff549b6bc581fdf # v2 with: tool: cargo-deny@0.20.2 @@ -295,6 +322,18 @@ jobs: if: steps.plan.outputs.cli_package == 'true' run: npm run release:cli:pack -- --allow-dirty + - name: Report CLI Rust build cache + if: steps.plan.outputs.cli_package == 'true' + shell: bash + run: kache report --format github --since 24h >> "$GITHUB_STEP_SUMMARY" + + - name: Save CLI Rust build cache + if: steps.plan.outputs.cli_package == 'true' && github.ref_name == github.event.repository.default_branch + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ runner.temp }}/kache-cli-package + key: ${{ steps.cli-kache-cache.outputs.cache-primary-key }} + - name: Validate installed CLI release candidate if: steps.plan.outputs.cli_package == 'true' run: npm run release:cli:smoke -- packages/cli/release/*.tgz diff --git a/.github/workflows/cli-package-validation.yml b/.github/workflows/cli-package-validation.yml index 68b36e7f30..fae1595dd3 100644 --- a/.github/workflows/cli-package-validation.yml +++ b/.github/workflows/cli-package-validation.yml @@ -97,6 +97,27 @@ jobs: persist-credentials: false - name: Update stable Rust run: rustup update stable --no-self-update + - id: rustc + name: Resolve Rust cache version + shell: bash + run: | + echo "version=$(rustc --version | cut -d ' ' -f 2)" >> "$GITHUB_OUTPUT" + { + echo "KACHE_CACHE_DIR=${{ runner.temp }}/kache" + echo "KACHE_RUNTIME_DIR=${{ runner.temp }}/kache-runtime" + echo "RUSTC_WRAPPER=kache" + } >> "$GITHUB_ENV" + - name: Install Kache + uses: taiki-e/install-action@1ed6d7be6168f6c9046541087ff549b6bc581fdf # v2 + with: + tool: kache@0.16.0 + - id: kache-cache + name: Restore Rust build cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ runner.temp }}/kache + key: kache-runtime-host-peer-release-${{ matrix.target }}-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }} + restore-keys: kache-runtime-host-peer-release-${{ matrix.target }}-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- - name: Install the Linux baseline linker if: startsWith(matrix.target, 'linux-') uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2 @@ -104,7 +125,7 @@ jobs: version: 0.16.0 - name: Install cargo-zigbuild if: startsWith(matrix.target, 'linux-') - uses: taiki-e/install-action@fcf5432d9f50d67e37ee6e29bdb7a224ff67b4a7 # v2 + uses: taiki-e/install-action@1ed6d7be6168f6c9046541087ff549b6bc581fdf # v2 with: tool: cargo-zigbuild@0.23.2 - name: Build the release addon @@ -112,6 +133,15 @@ jobs: MAKA_RUNTIME_HOST_PEER_CARGO_SUBCOMMAND: ${{ matrix.rust_target && 'zigbuild' || '' }} MAKA_RUNTIME_HOST_PEER_CARGO_TARGET: ${{ matrix.rust_target }} run: node native/runtime-host-peer/build.mjs + - name: Report Rust build cache + shell: bash + run: kache report --format github --since 24h >> "$GITHUB_STEP_SUMMARY" + - name: Save Rust build cache + if: github.ref_name == github.event.repository.default_branch + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ runner.temp }}/kache + key: ${{ steps.kache-cache.outputs.cache-primary-key }} - name: Enforce the Linux glibc baseline if: startsWith(matrix.target, 'linux-') run: | @@ -160,7 +190,7 @@ jobs: - name: Select the release npm toolchain run: npm install --global --no-audit --no-fund "$(node -p 'require("./package.json").packageManager')" - name: Install cargo-deny - uses: taiki-e/install-action@fcf5432d9f50d67e37ee6e29bdb7a224ff67b4a7 # v2 + uses: taiki-e/install-action@1ed6d7be6168f6c9046541087ff549b6bc581fdf # v2 with: tool: cargo-deny@0.20.2 - name: Download direct-peer addons diff --git a/.github/workflows/gitoxide-helper-admission.yml b/.github/workflows/gitoxide-helper-admission.yml index 5c86602d93..9e12b3b889 100644 --- a/.github/workflows/gitoxide-helper-admission.yml +++ b/.github/workflows/gitoxide-helper-admission.yml @@ -68,12 +68,42 @@ jobs: with: node-version: 24.18.1 cache: npm + - id: rustc + name: Resolve Rust cache version + shell: bash + run: | + echo "version=$(rustc --version | cut -d ' ' -f 2)" >> "$GITHUB_OUTPUT" + { + echo "KACHE_CACHE_DIR=${{ runner.temp }}/kache" + echo "KACHE_RUNTIME_DIR=${{ runner.temp }}/kache-runtime" + echo "RUSTC_WRAPPER=kache" + } >> "$GITHUB_ENV" + - name: Install Kache + uses: taiki-e/install-action@1ed6d7be6168f6c9046541087ff549b6bc581fdf # v2 + with: + tool: kache@0.16.0 + - id: kache-cache + name: Restore Rust build cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ runner.temp }}/kache + key: kache-gitoxide-helper-test-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/gitoxide-helper/Cargo.lock') }} + restore-keys: kache-gitoxide-helper-test-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- - name: Check Rust formatting working-directory: native/gitoxide-helper run: cargo fmt --check - name: Test the short-lived Gitoxide helper working-directory: native/gitoxide-helper run: cargo test --locked + - name: Report Rust build cache + shell: bash + run: kache report --format github --since 24h >> "$GITHUB_STEP_SUMMARY" + - name: Save Rust build cache + if: github.ref_name == github.event.repository.default_branch + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ runner.temp }}/kache + key: ${{ steps.kache-cache.outputs.cache-primary-key }} - name: Install JavaScript dependencies without packaging hooks run: npm ci --ignore-scripts - name: Build the helper invocation owner diff --git a/.github/workflows/runtime-host-peer-admission.yml b/.github/workflows/runtime-host-peer-admission.yml index ed7e116e54..1c7dd7ed7b 100644 --- a/.github/workflows/runtime-host-peer-admission.yml +++ b/.github/workflows/runtime-host-peer-admission.yml @@ -64,6 +64,27 @@ jobs: node-version: 24.18.1 - name: Update stable Rust run: rustup update stable --no-self-update + - id: rustc + name: Resolve Rust cache version + shell: bash + run: | + echo "version=$(rustc --version | cut -d ' ' -f 2)" >> "$GITHUB_OUTPUT" + { + echo "KACHE_CACHE_DIR=${{ runner.temp }}/kache" + echo "KACHE_RUNTIME_DIR=${{ runner.temp }}/kache-runtime" + echo "RUSTC_WRAPPER=kache" + } >> "$GITHUB_ENV" + - name: Install Kache + uses: taiki-e/install-action@1ed6d7be6168f6c9046541087ff549b6bc581fdf # v2 + with: + tool: kache@0.16.0 + - id: kache-cache + name: Restore Rust build cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ runner.temp }}/kache + key: kache-runtime-host-peer-quality-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }} + restore-keys: kache-runtime-host-peer-quality-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- - name: Check Rust formatting working-directory: native/runtime-host-peer run: cargo fmt --check @@ -71,7 +92,7 @@ jobs: working-directory: native/runtime-host-peer run: cargo clippy --locked --all-targets -- -D warnings - name: Install cargo-deny - uses: taiki-e/install-action@fcf5432d9f50d67e37ee6e29bdb7a224ff67b4a7 # v2 + uses: taiki-e/install-action@1ed6d7be6168f6c9046541087ff549b6bc581fdf # v2 with: tool: cargo-deny@0.20.2 - name: Check Cargo dependency inventory @@ -83,3 +104,12 @@ jobs: - name: Test the native peer working-directory: native/runtime-host-peer run: cargo test --locked + - name: Report Rust build cache + shell: bash + run: kache report --format github --since 24h >> "$GITHUB_STEP_SUMMARY" + - name: Save Rust build cache + if: github.ref_name == github.event.repository.default_branch + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ runner.temp }}/kache + key: ${{ steps.kache-cache.outputs.cache-primary-key }} diff --git a/.github/workflows/windows-sandbox-w0.yml b/.github/workflows/windows-sandbox-w0.yml index fc854df250..6e6d333150 100644 --- a/.github/workflows/windows-sandbox-w0.yml +++ b/.github/workflows/windows-sandbox-w0.yml @@ -57,6 +57,27 @@ jobs: with: node-version: '24' cache: npm + - id: rustc + name: Resolve Rust cache version + shell: bash + run: | + echo "version=$(rustc --version | cut -d ' ' -f 2)" >> "$GITHUB_OUTPUT" + { + echo "KACHE_CACHE_DIR=${{ runner.temp }}/kache" + echo "KACHE_RUNTIME_DIR=${{ runner.temp }}/kache-runtime" + echo "RUSTC_WRAPPER=kache" + } >> "$GITHUB_ENV" + - name: Install Kache + uses: taiki-e/install-action@1ed6d7be6168f6c9046541087ff549b6bc581fdf # v2 + with: + tool: kache@0.16.0 + - id: kache-cache + name: Restore Rust build cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ runner.temp }}/kache + key: kache-windows-sandbox-launcher-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('experiments/windows-sandbox/launcher/Cargo.lock') }} + restore-keys: kache-windows-sandbox-launcher-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- - name: Record atomic launcher capability shell: pwsh run: ./experiments/windows-sandbox/atomic-launch-capability.ps1 @@ -69,6 +90,15 @@ jobs: - name: Verify launcher protocol and broker authorization working-directory: experiments/windows-sandbox/launcher run: cargo test --locked + - name: Report Rust build cache + shell: bash + run: kache report --format github --since 24h >> "$GITHUB_STEP_SUMMARY" + - name: Save Rust build cache + if: github.ref_name == github.event.repository.default_branch + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ runner.temp }}/kache + key: ${{ steps.kache-cache.outputs.cache-primary-key }} - name: Verify secure broker pipe shell: pwsh run: ./experiments/windows-sandbox/broker-pipe-smoke.ps1 From 20813ab75fc66c994f1178936ccdcbc5f53cf433 Mon Sep 17 00:00:00 2001 From: M4n5ter Date: Mon, 31 Aug 2026 16:45:50 +0800 Subject: [PATCH 2/4] ci: advance Kache cache generations --- .github/workflows/ci.yml | 9 ++- .github/workflows/cli-package-validation.yml | 9 ++- .../workflows/gitoxide-helper-admission.yml | 9 ++- .github/workflows/release-windows-check.yml | 59 ++++++++++++++++++- .../workflows/runtime-host-peer-admission.yml | 9 ++- .github/workflows/windows-sandbox-w0.yml | 9 ++- scripts/ci-test-plan.test.mjs | 23 ++++++++ 7 files changed, 111 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4797eced06..0ad62422f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -291,6 +291,7 @@ jobs: shell: bash run: | echo "version=$(rustc --version | cut -d ' ' -f 2)" >> "$GITHUB_OUTPUT" + echo "revision=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" { echo "KACHE_CACHE_DIR=${{ runner.temp }}/kache-cli-package" echo "KACHE_RUNTIME_DIR=${{ runner.temp }}/kache-cli-package-runtime" @@ -309,8 +310,10 @@ jobs: uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ runner.temp }}/kache-cli-package - key: kache-runtime-host-peer-cli-package-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.cli-rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }} - restore-keys: kache-runtime-host-peer-cli-package-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.cli-rustc.outputs.version }}- + key: kache-runtime-host-peer-cli-package-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.cli-rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}-${{ steps.cli-rustc.outputs.revision }} + restore-keys: | + kache-runtime-host-peer-cli-package-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.cli-rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}- + kache-runtime-host-peer-cli-package-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.cli-rustc.outputs.version }}- - name: Install cargo-deny for CLI packaging if: steps.plan.outputs.cli_package == 'true' @@ -325,7 +328,7 @@ jobs: - name: Report CLI Rust build cache if: steps.plan.outputs.cli_package == 'true' shell: bash - run: kache report --format github --since 24h >> "$GITHUB_STEP_SUMMARY" + run: kache report --format github >> "$GITHUB_STEP_SUMMARY" - name: Save CLI Rust build cache if: steps.plan.outputs.cli_package == 'true' && github.ref_name == github.event.repository.default_branch diff --git a/.github/workflows/cli-package-validation.yml b/.github/workflows/cli-package-validation.yml index fae1595dd3..837743d5df 100644 --- a/.github/workflows/cli-package-validation.yml +++ b/.github/workflows/cli-package-validation.yml @@ -102,6 +102,7 @@ jobs: shell: bash run: | echo "version=$(rustc --version | cut -d ' ' -f 2)" >> "$GITHUB_OUTPUT" + echo "revision=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" { echo "KACHE_CACHE_DIR=${{ runner.temp }}/kache" echo "KACHE_RUNTIME_DIR=${{ runner.temp }}/kache-runtime" @@ -116,8 +117,10 @@ jobs: uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ runner.temp }}/kache - key: kache-runtime-host-peer-release-${{ matrix.target }}-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }} - restore-keys: kache-runtime-host-peer-release-${{ matrix.target }}-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- + key: kache-runtime-host-peer-release-${{ matrix.target }}-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}-${{ steps.rustc.outputs.revision }} + restore-keys: | + kache-runtime-host-peer-release-${{ matrix.target }}-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}- + kache-runtime-host-peer-release-${{ matrix.target }}-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- - name: Install the Linux baseline linker if: startsWith(matrix.target, 'linux-') uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2 @@ -135,7 +138,7 @@ jobs: run: node native/runtime-host-peer/build.mjs - name: Report Rust build cache shell: bash - run: kache report --format github --since 24h >> "$GITHUB_STEP_SUMMARY" + run: kache report --format github >> "$GITHUB_STEP_SUMMARY" - name: Save Rust build cache if: github.ref_name == github.event.repository.default_branch uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 diff --git a/.github/workflows/gitoxide-helper-admission.yml b/.github/workflows/gitoxide-helper-admission.yml index 9e12b3b889..1b97992be1 100644 --- a/.github/workflows/gitoxide-helper-admission.yml +++ b/.github/workflows/gitoxide-helper-admission.yml @@ -73,6 +73,7 @@ jobs: shell: bash run: | echo "version=$(rustc --version | cut -d ' ' -f 2)" >> "$GITHUB_OUTPUT" + echo "revision=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" { echo "KACHE_CACHE_DIR=${{ runner.temp }}/kache" echo "KACHE_RUNTIME_DIR=${{ runner.temp }}/kache-runtime" @@ -87,8 +88,10 @@ jobs: uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ runner.temp }}/kache - key: kache-gitoxide-helper-test-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/gitoxide-helper/Cargo.lock') }} - restore-keys: kache-gitoxide-helper-test-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- + key: kache-gitoxide-helper-test-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/gitoxide-helper/Cargo.lock') }}-${{ steps.rustc.outputs.revision }} + restore-keys: | + kache-gitoxide-helper-test-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/gitoxide-helper/Cargo.lock') }}- + kache-gitoxide-helper-test-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- - name: Check Rust formatting working-directory: native/gitoxide-helper run: cargo fmt --check @@ -97,7 +100,7 @@ jobs: run: cargo test --locked - name: Report Rust build cache shell: bash - run: kache report --format github --since 24h >> "$GITHUB_STEP_SUMMARY" + run: kache report --format github >> "$GITHUB_STEP_SUMMARY" - name: Save Rust build cache if: github.ref_name == github.event.repository.default_branch uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 diff --git a/.github/workflows/release-windows-check.yml b/.github/workflows/release-windows-check.yml index bc99c6e019..84f9675f6b 100644 --- a/.github/workflows/release-windows-check.yml +++ b/.github/workflows/release-windows-check.yml @@ -29,7 +29,7 @@ on: # caller and runs only under `check:release`, `.gitattributes` decides whether # generated bytes survive checkout, and the manifests own the command wiring # and the native module graph. Each of those has already broken this path once. - paths: + paths: &release-windows-paths - 'apps/desktop/electron-builder.config.mjs' - 'apps/desktop/package.json' - 'native/runtime-host-peer/**' @@ -94,6 +94,12 @@ on: - 'apps/desktop/resources/licenses/cargo/THIRD_PARTY_NOTICES.txt' - '.github/workflows/release.yml' - '.github/workflows/release-windows-check.yml' + # The pull-request job consumes this cache without writing to it. Once the + # same source reaches main, this lightweight mode advances the immutable + # cache generation without repeating the installer lifecycle gate. + push: + branches: [main] + paths: *release-windows-paths workflow_dispatch: permissions: @@ -127,16 +133,63 @@ jobs: - name: Update stable Rust for Desktop native artifacts run: rustup update stable --no-self-update + - id: rustc + name: Resolve Rust cache identity + shell: bash + run: | + echo "version=$(rustc --version | cut -d ' ' -f 2)" >> "$GITHUB_OUTPUT" + echo "revision=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" + { + echo "KACHE_CACHE_DIR=${{ runner.temp }}/kache" + echo "KACHE_RUNTIME_DIR=${{ runner.temp }}/kache-runtime" + echo "RUSTC_WRAPPER=kache" + } >> "$GITHUB_ENV" + + - name: Install Kache + uses: taiki-e/install-action@1ed6d7be6168f6c9046541087ff549b6bc581fdf # v2 + with: + tool: kache@0.16.0 + + - id: kache-cache + name: Restore Windows release Rust build cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ runner.temp }}/kache + key: kache-windows-release-native-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}-${{ hashFiles('experiments/windows-sandbox/launcher/Cargo.lock') }}-${{ steps.rustc.outputs.revision }} + restore-keys: | + kache-windows-release-native-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}-${{ hashFiles('experiments/windows-sandbox/launcher/Cargo.lock') }}- + kache-windows-release-native-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- + + - name: Seed Windows release Rust artifacts + if: github.event_name == 'push' + run: | + npm run build:runtime-host-peer + cargo build --manifest-path experiments/windows-sandbox/launcher/Cargo.toml --release --locked + - name: Package the Windows installer and ZIP + if: github.event_name != 'push' run: npm run package:windows-x64 + - name: Report Windows release Rust build cache + shell: bash + run: kache report --format github >> "$GITHUB_STEP_SUMMARY" + + - name: Save Windows release Rust build cache + if: github.ref_name == github.event.repository.default_branch + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ runner.temp }}/kache + key: ${{ steps.kache-cache.outputs.cache-primary-key }} + - name: Verify the Windows release + if: github.event_name != 'push' run: | version="$(node -p "require('./apps/desktop/package.json').version")" npm run verify:windows-x64 -- "apps/desktop/release/Maka-${version}-win-x64.exe" - name: Download and verify the pinned Windows upgrade baseline id: previous + if: github.event_name != 'push' env: GH_TOKEN: ${{ github.token }} run: | @@ -146,6 +199,7 @@ jobs: echo "exe=$previous_exe" >> "$GITHUB_OUTPUT" - name: Exercise pinned-version upgrade and uninstall + if: github.event_name != 'push' run: | version="$(node -p "require('./apps/desktop/package.json').version")" npm run verify:windows-installer -- \ @@ -153,9 +207,11 @@ jobs: "${{ steps.previous.outputs.exe }}" - name: Build the version-bumped autoupdate installer + if: github.event_name != 'push' run: npm run package:windows-autoupdate-next - name: Verify automatic update end to end + if: github.event_name != 'push' run: | version="$(node -p "require('./apps/desktop/package.json').version")" npm run verify:windows-autoupdate -- \ @@ -163,6 +219,7 @@ jobs: apps/desktop/release-autoupdate-next - name: Prove deterministic mid-install failure rollback + if: github.event_name != 'push' run: | version="$(node -p "require('./apps/desktop/package.json').version")" npm run verify:windows-installer-rollback -- \ diff --git a/.github/workflows/runtime-host-peer-admission.yml b/.github/workflows/runtime-host-peer-admission.yml index 1c7dd7ed7b..9146e4a5e0 100644 --- a/.github/workflows/runtime-host-peer-admission.yml +++ b/.github/workflows/runtime-host-peer-admission.yml @@ -69,6 +69,7 @@ jobs: shell: bash run: | echo "version=$(rustc --version | cut -d ' ' -f 2)" >> "$GITHUB_OUTPUT" + echo "revision=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" { echo "KACHE_CACHE_DIR=${{ runner.temp }}/kache" echo "KACHE_RUNTIME_DIR=${{ runner.temp }}/kache-runtime" @@ -83,8 +84,10 @@ jobs: uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ runner.temp }}/kache - key: kache-runtime-host-peer-quality-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }} - restore-keys: kache-runtime-host-peer-quality-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- + key: kache-runtime-host-peer-quality-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}-${{ steps.rustc.outputs.revision }} + restore-keys: | + kache-runtime-host-peer-quality-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}- + kache-runtime-host-peer-quality-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- - name: Check Rust formatting working-directory: native/runtime-host-peer run: cargo fmt --check @@ -106,7 +109,7 @@ jobs: run: cargo test --locked - name: Report Rust build cache shell: bash - run: kache report --format github --since 24h >> "$GITHUB_STEP_SUMMARY" + run: kache report --format github >> "$GITHUB_STEP_SUMMARY" - name: Save Rust build cache if: github.ref_name == github.event.repository.default_branch uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 diff --git a/.github/workflows/windows-sandbox-w0.yml b/.github/workflows/windows-sandbox-w0.yml index 6e6d333150..874754e94a 100644 --- a/.github/workflows/windows-sandbox-w0.yml +++ b/.github/workflows/windows-sandbox-w0.yml @@ -62,6 +62,7 @@ jobs: shell: bash run: | echo "version=$(rustc --version | cut -d ' ' -f 2)" >> "$GITHUB_OUTPUT" + echo "revision=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" { echo "KACHE_CACHE_DIR=${{ runner.temp }}/kache" echo "KACHE_RUNTIME_DIR=${{ runner.temp }}/kache-runtime" @@ -76,8 +77,10 @@ jobs: uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ runner.temp }}/kache - key: kache-windows-sandbox-launcher-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('experiments/windows-sandbox/launcher/Cargo.lock') }} - restore-keys: kache-windows-sandbox-launcher-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- + key: kache-windows-sandbox-launcher-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('experiments/windows-sandbox/launcher/Cargo.lock') }}-${{ steps.rustc.outputs.revision }} + restore-keys: | + kache-windows-sandbox-launcher-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('experiments/windows-sandbox/launcher/Cargo.lock') }}- + kache-windows-sandbox-launcher-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- - name: Record atomic launcher capability shell: pwsh run: ./experiments/windows-sandbox/atomic-launch-capability.ps1 @@ -92,7 +95,7 @@ jobs: run: cargo test --locked - name: Report Rust build cache shell: bash - run: kache report --format github --since 24h >> "$GITHUB_STEP_SUMMARY" + run: kache report --format github >> "$GITHUB_STEP_SUMMARY" - name: Save Rust build cache if: github.ref_name == github.event.repository.default_branch uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 diff --git a/scripts/ci-test-plan.test.mjs b/scripts/ci-test-plan.test.mjs index a657ab3450..1aa1aa9532 100644 --- a/scripts/ci-test-plan.test.mjs +++ b/scripts/ci-test-plan.test.mjs @@ -352,6 +352,29 @@ test('core CI validates affected installed CLI packages on its existing runner', assert.match(workflow, /run: npm run release:cli:smoke/u); }); +test('Rust build caches publish immutable source generations only from the default branch', () => { + const workflows = readdirSync(WORKFLOW_DIR) + .filter((name) => name.endsWith('.yml')) + .map((name) => [name, readWorkflow(name)]) + .filter(([, workflow]) => workflow.includes('tool: kache@0.16.0')); + + assert.equal(workflows.length, 6); + for (const [name, workflow] of workflows) { + assert.match(workflow, /echo "revision=\$\(git rev-parse HEAD\)"/u, name); + const primaryKeys = [...workflow.matchAll(/^\s+key: (kache-[^\n]+)$/gmu)].map(([, key]) => key); + assert.ok(primaryKeys.length > 0, name); + primaryKeys.forEach((key) => + assert.match(key, /\$\{\{ steps\.[^.]+\.outputs\.revision \}\}$/u, name), + ); + assert.match( + workflow, + /name: Save [^\n]*Rust build cache\n\s+if: [^\n]*github\.event\.repository\.default_branch/u, + name, + ); + assert.doesNotMatch(workflow, /kache report [^\n]*--since/u, name); + } +}); + test('release contracts run against built CLI outputs', () => { const workflow = readWorkflow('ci.yml'); const buildIndex = workflow.indexOf(' - name: Build\n'); From 2575f089f251a0ff0f8c13302dae4c432b890c17 Mon Sep 17 00:00:00 2001 From: M4n5ter Date: Mon, 31 Aug 2026 16:55:34 +0800 Subject: [PATCH 3/4] ci: keep Kache on primary Rust lanes --- .github/workflows/release-windows-check.yml | 59 +-------------------- scripts/ci-test-plan.test.mjs | 2 +- 2 files changed, 2 insertions(+), 59 deletions(-) diff --git a/.github/workflows/release-windows-check.yml b/.github/workflows/release-windows-check.yml index 84f9675f6b..bc99c6e019 100644 --- a/.github/workflows/release-windows-check.yml +++ b/.github/workflows/release-windows-check.yml @@ -29,7 +29,7 @@ on: # caller and runs only under `check:release`, `.gitattributes` decides whether # generated bytes survive checkout, and the manifests own the command wiring # and the native module graph. Each of those has already broken this path once. - paths: &release-windows-paths + paths: - 'apps/desktop/electron-builder.config.mjs' - 'apps/desktop/package.json' - 'native/runtime-host-peer/**' @@ -94,12 +94,6 @@ on: - 'apps/desktop/resources/licenses/cargo/THIRD_PARTY_NOTICES.txt' - '.github/workflows/release.yml' - '.github/workflows/release-windows-check.yml' - # The pull-request job consumes this cache without writing to it. Once the - # same source reaches main, this lightweight mode advances the immutable - # cache generation without repeating the installer lifecycle gate. - push: - branches: [main] - paths: *release-windows-paths workflow_dispatch: permissions: @@ -133,63 +127,16 @@ jobs: - name: Update stable Rust for Desktop native artifacts run: rustup update stable --no-self-update - - id: rustc - name: Resolve Rust cache identity - shell: bash - run: | - echo "version=$(rustc --version | cut -d ' ' -f 2)" >> "$GITHUB_OUTPUT" - echo "revision=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" - { - echo "KACHE_CACHE_DIR=${{ runner.temp }}/kache" - echo "KACHE_RUNTIME_DIR=${{ runner.temp }}/kache-runtime" - echo "RUSTC_WRAPPER=kache" - } >> "$GITHUB_ENV" - - - name: Install Kache - uses: taiki-e/install-action@1ed6d7be6168f6c9046541087ff549b6bc581fdf # v2 - with: - tool: kache@0.16.0 - - - id: kache-cache - name: Restore Windows release Rust build cache - uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ${{ runner.temp }}/kache - key: kache-windows-release-native-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}-${{ hashFiles('experiments/windows-sandbox/launcher/Cargo.lock') }}-${{ steps.rustc.outputs.revision }} - restore-keys: | - kache-windows-release-native-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}-${{ hashFiles('experiments/windows-sandbox/launcher/Cargo.lock') }}- - kache-windows-release-native-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- - - - name: Seed Windows release Rust artifacts - if: github.event_name == 'push' - run: | - npm run build:runtime-host-peer - cargo build --manifest-path experiments/windows-sandbox/launcher/Cargo.toml --release --locked - - name: Package the Windows installer and ZIP - if: github.event_name != 'push' run: npm run package:windows-x64 - - name: Report Windows release Rust build cache - shell: bash - run: kache report --format github >> "$GITHUB_STEP_SUMMARY" - - - name: Save Windows release Rust build cache - if: github.ref_name == github.event.repository.default_branch - uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 - with: - path: ${{ runner.temp }}/kache - key: ${{ steps.kache-cache.outputs.cache-primary-key }} - - name: Verify the Windows release - if: github.event_name != 'push' run: | version="$(node -p "require('./apps/desktop/package.json').version")" npm run verify:windows-x64 -- "apps/desktop/release/Maka-${version}-win-x64.exe" - name: Download and verify the pinned Windows upgrade baseline id: previous - if: github.event_name != 'push' env: GH_TOKEN: ${{ github.token }} run: | @@ -199,7 +146,6 @@ jobs: echo "exe=$previous_exe" >> "$GITHUB_OUTPUT" - name: Exercise pinned-version upgrade and uninstall - if: github.event_name != 'push' run: | version="$(node -p "require('./apps/desktop/package.json').version")" npm run verify:windows-installer -- \ @@ -207,11 +153,9 @@ jobs: "${{ steps.previous.outputs.exe }}" - name: Build the version-bumped autoupdate installer - if: github.event_name != 'push' run: npm run package:windows-autoupdate-next - name: Verify automatic update end to end - if: github.event_name != 'push' run: | version="$(node -p "require('./apps/desktop/package.json').version")" npm run verify:windows-autoupdate -- \ @@ -219,7 +163,6 @@ jobs: apps/desktop/release-autoupdate-next - name: Prove deterministic mid-install failure rollback - if: github.event_name != 'push' run: | version="$(node -p "require('./apps/desktop/package.json').version")" npm run verify:windows-installer-rollback -- \ diff --git a/scripts/ci-test-plan.test.mjs b/scripts/ci-test-plan.test.mjs index 1aa1aa9532..3956ae325b 100644 --- a/scripts/ci-test-plan.test.mjs +++ b/scripts/ci-test-plan.test.mjs @@ -358,7 +358,7 @@ test('Rust build caches publish immutable source generations only from the defau .map((name) => [name, readWorkflow(name)]) .filter(([, workflow]) => workflow.includes('tool: kache@0.16.0')); - assert.equal(workflows.length, 6); + assert.equal(workflows.length, 5); for (const [name, workflow] of workflows) { assert.match(workflow, /echo "revision=\$\(git rev-parse HEAD\)"/u, name); const primaryKeys = [...workflow.matchAll(/^\s+key: (kache-[^\n]+)$/gmu)].map(([, key]) => key); From 7a50459cf6d2eed20cfa88340ba12e1045ba4dea Mon Sep 17 00:00:00 2001 From: M4n5ter Date: Mon, 31 Aug 2026 17:20:45 +0800 Subject: [PATCH 4/4] ci: simplify Kache cache lineage --- .github/workflows/ci.yml | 3 +-- .github/workflows/cli-package-validation.yml | 3 +-- .github/workflows/gitoxide-helper-admission.yml | 3 +-- .github/workflows/runtime-host-peer-admission.yml | 3 +-- .github/workflows/windows-sandbox-w0.yml | 3 +-- scripts/ci-test-plan.test.mjs | 12 +++++++++--- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ad62422f2..1f92486daa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -310,9 +310,8 @@ jobs: uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ runner.temp }}/kache-cli-package - key: kache-runtime-host-peer-cli-package-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.cli-rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}-${{ steps.cli-rustc.outputs.revision }} + key: kache-runtime-host-peer-cli-package-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.cli-rustc.outputs.version }}-${{ steps.cli-rustc.outputs.revision }} restore-keys: | - kache-runtime-host-peer-cli-package-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.cli-rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}- kache-runtime-host-peer-cli-package-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.cli-rustc.outputs.version }}- - name: Install cargo-deny for CLI packaging diff --git a/.github/workflows/cli-package-validation.yml b/.github/workflows/cli-package-validation.yml index 837743d5df..800a39fafe 100644 --- a/.github/workflows/cli-package-validation.yml +++ b/.github/workflows/cli-package-validation.yml @@ -117,9 +117,8 @@ jobs: uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ runner.temp }}/kache - key: kache-runtime-host-peer-release-${{ matrix.target }}-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}-${{ steps.rustc.outputs.revision }} + key: kache-runtime-host-peer-release-${{ matrix.target }}-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ steps.rustc.outputs.revision }} restore-keys: | - kache-runtime-host-peer-release-${{ matrix.target }}-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}- kache-runtime-host-peer-release-${{ matrix.target }}-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- - name: Install the Linux baseline linker if: startsWith(matrix.target, 'linux-') diff --git a/.github/workflows/gitoxide-helper-admission.yml b/.github/workflows/gitoxide-helper-admission.yml index 1b97992be1..5d16b4dab1 100644 --- a/.github/workflows/gitoxide-helper-admission.yml +++ b/.github/workflows/gitoxide-helper-admission.yml @@ -88,9 +88,8 @@ jobs: uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ runner.temp }}/kache - key: kache-gitoxide-helper-test-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/gitoxide-helper/Cargo.lock') }}-${{ steps.rustc.outputs.revision }} + key: kache-gitoxide-helper-test-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ steps.rustc.outputs.revision }} restore-keys: | - kache-gitoxide-helper-test-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/gitoxide-helper/Cargo.lock') }}- kache-gitoxide-helper-test-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- - name: Check Rust formatting working-directory: native/gitoxide-helper diff --git a/.github/workflows/runtime-host-peer-admission.yml b/.github/workflows/runtime-host-peer-admission.yml index 9146e4a5e0..1a6036ba4e 100644 --- a/.github/workflows/runtime-host-peer-admission.yml +++ b/.github/workflows/runtime-host-peer-admission.yml @@ -84,9 +84,8 @@ jobs: uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ runner.temp }}/kache - key: kache-runtime-host-peer-quality-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}-${{ steps.rustc.outputs.revision }} + key: kache-runtime-host-peer-quality-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ steps.rustc.outputs.revision }} restore-keys: | - kache-runtime-host-peer-quality-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('native/runtime-host-peer/Cargo.lock') }}- kache-runtime-host-peer-quality-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- - name: Check Rust formatting working-directory: native/runtime-host-peer diff --git a/.github/workflows/windows-sandbox-w0.yml b/.github/workflows/windows-sandbox-w0.yml index 874754e94a..d20131f0cc 100644 --- a/.github/workflows/windows-sandbox-w0.yml +++ b/.github/workflows/windows-sandbox-w0.yml @@ -77,9 +77,8 @@ jobs: uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ runner.temp }}/kache - key: kache-windows-sandbox-launcher-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('experiments/windows-sandbox/launcher/Cargo.lock') }}-${{ steps.rustc.outputs.revision }} + key: kache-windows-sandbox-launcher-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ steps.rustc.outputs.revision }} restore-keys: | - kache-windows-sandbox-launcher-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}-${{ hashFiles('experiments/windows-sandbox/launcher/Cargo.lock') }}- kache-windows-sandbox-launcher-v0.16.0-${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.rustc.outputs.version }}- - name: Record atomic launcher capability shell: pwsh diff --git a/scripts/ci-test-plan.test.mjs b/scripts/ci-test-plan.test.mjs index 3956ae325b..bc1a23c938 100644 --- a/scripts/ci-test-plan.test.mjs +++ b/scripts/ci-test-plan.test.mjs @@ -363,9 +363,15 @@ test('Rust build caches publish immutable source generations only from the defau assert.match(workflow, /echo "revision=\$\(git rev-parse HEAD\)"/u, name); const primaryKeys = [...workflow.matchAll(/^\s+key: (kache-[^\n]+)$/gmu)].map(([, key]) => key); assert.ok(primaryKeys.length > 0, name); - primaryKeys.forEach((key) => - assert.match(key, /\$\{\{ steps\.[^.]+\.outputs\.revision \}\}$/u, name), - ); + const restoreKeys = [...workflow.matchAll(/^\s+(kache-[^\n]+-)$/gmu)].map(([, key]) => key); + assert.equal(restoreKeys.length, primaryKeys.length, name); + primaryKeys.forEach((key) => { + assert.match(key, /\$\{\{ steps\.[^.]+\.outputs\.revision \}\}$/u, name); + assert.ok( + restoreKeys.includes(key.replace(/\$\{\{ steps\.[^.]+\.outputs\.revision \}\}$/u, '')), + name, + ); + }); assert.match( workflow, /name: Save [^\n]*Rust build cache\n\s+if: [^\n]*github\.event\.repository\.default_branch/u,