From 0408d7640d4b4e84a76ab6e98ecf07a236e166de Mon Sep 17 00:00:00 2001 From: cunoe Date: Thu, 12 Nov 2026 23:53:02 -0800 Subject: [PATCH 1/2] ci: save caches only from main The repository's Actions cache holds 11.56 GB in 19 entries against the 10 GB limit, so GitHub keeps evicting the least recently used entries. Only 5.5 GB belongs to main. The rest was written by manual runs on development branches (3.5, 1.06 and 0.48 GB this week) and by a release tag (0.44 GB). A cache saved on a branch or tag can only be restored by that same ref, so those entries serve almost nothing while they push out main's caches, and every branch then starts from a cold or partial build. Nine rust-cache steps saved on main or any workflow_dispatch, including release dispatches on tags. Eight rust-cache steps and the Chromium cache had no save condition, so release tags, the merge queue and branches all wrote. The simulator app cache saved on any ref. Every rust-cache step now saves only on refs/heads/main; other refs keep restoring main's caches. Chromium uses restore plus a main-only save, and the simulator app saves only on main. Manual-only workflows now start from main's caches, and are cold until they have run on main once. --- .github/workflows/_ci-crypto.yml | 2 +- .github/workflows/ci-desktop.yml | 2 +- .github/workflows/ci-native-diagnostics.yml | 1 + .github/workflows/ci-windows-native.yml | 2 +- .github/workflows/ci.yml | 25 ++++++++++++++------- .github/workflows/mobile.yml | 5 ++++- .github/workflows/release-apps.yml | 2 ++ .github/workflows/release-desktop.yml | 2 +- .github/workflows/release-ios.yml | 4 +++- .github/workflows/release-native.yml | 2 ++ .github/workflows/release.yml | 2 ++ 11 files changed, 35 insertions(+), 14 deletions(-) diff --git a/.github/workflows/_ci-crypto.yml b/.github/workflows/_ci-crypto.yml index 901c5ef7..8c62c8d4 100644 --- a/.github/workflows/_ci-crypto.yml +++ b/.github/workflows/_ci-crypto.yml @@ -22,7 +22,7 @@ jobs: - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 with: key: crypto-web - save-if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: '22' diff --git a/.github/workflows/ci-desktop.yml b/.github/workflows/ci-desktop.yml index bc5f4bdb..cadb9187 100644 --- a/.github/workflows/ci-desktop.yml +++ b/.github/workflows/ci-desktop.yml @@ -46,7 +46,7 @@ jobs: with: key: gpui-native-${{ inputs.target }} cache-on-failure: true - save-if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - uses: ./.github/actions/msvc-environment if: runner.os == 'Windows' - name: Select this platform's Python diff --git a/.github/workflows/ci-native-diagnostics.yml b/.github/workflows/ci-native-diagnostics.yml index 1bc48a76..c750b0e4 100644 --- a/.github/workflows/ci-native-diagnostics.yml +++ b/.github/workflows/ci-native-diagnostics.yml @@ -79,6 +79,7 @@ jobs: with: key: gpui-native-prepare cache-on-failure: true + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Resolve workspace additions while preserving locked third-party packages id: lockfile run: | diff --git a/.github/workflows/ci-windows-native.yml b/.github/workflows/ci-windows-native.yml index aba2c307..bc5d3cf9 100644 --- a/.github/workflows/ci-windows-native.yml +++ b/.github/workflows/ci-windows-native.yml @@ -39,7 +39,7 @@ jobs: with: key: ci-windows-native-${{ matrix.scope }} cache-on-failure: true - save-if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 with: {python-version: '3.12'} - name: Select this platform's Python diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54f430bb..92010c9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -239,7 +239,9 @@ jobs: with: {persist-credentials: false} - uses: ./.github/actions/native-desktop - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 - with: {key: gpui-feature-check} + with: + key: gpui-feature-check + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Check and test the native desktop host run: | cargo fmt --all -- --check @@ -261,7 +263,7 @@ jobs: - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 with: shared-key: check - save-if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Check affected crates with Clippy and optional minimum Rust version env: CI_PLAN: ${{ needs.plan.outputs.plan }} @@ -286,7 +288,7 @@ jobs: - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 with: shared-key: test-opt1 - save-if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Run affected Rust tests except the exact heavy scenarios env: CI_PLAN: ${{ needs.plan.outputs.plan }} @@ -318,7 +320,7 @@ jobs: - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 with: shared-key: test-opt1 - save-if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Run the exact heavy Node scenarios env: CI_PLAN: ${{ needs.plan.outputs.plan }} @@ -353,7 +355,7 @@ jobs: - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 with: key: delivery - save-if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }} + save-if: ${{ github.ref == 'refs/heads/main' }} workspaces: | . -> .artifacts/vdp/domain-target crates/delivery/proof -> ../../../.artifacts/vdp/proof-target @@ -420,7 +422,7 @@ jobs: workspaces: | . -> target tests/fixtures/delivery-probe -> ../../../.artifacts/delivery-probe/target - save-if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 with: python-version: '3.12' @@ -562,9 +564,10 @@ jobs: if: matrix.target == 'x86_64-unknown-linux-gnu' with: apply: 'true' - - name: Cache Chromium binaries + - name: Restore Chromium binaries + id: chromium if: matrix.target == 'x86_64-unknown-linux-gnu' - uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 + uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 with: path: .artifacts/e2e/browsers key: ${{ matrix.runner }}-${{ runner.arch }}-chromium-${{ hashFiles('pnpm-lock.yaml') }} @@ -579,6 +582,12 @@ jobs: pnpm test:e2e:check pnpm exec e2e-web install chromium --with-deps pnpm test:e2e + - name: Save Chromium binaries from main + if: matrix.target == 'x86_64-unknown-linux-gnu' && github.ref == 'refs/heads/main' && steps.chromium.outputs.cache-hit != 'true' + uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 + with: + path: .artifacts/e2e/browsers + key: ${{ steps.chromium.outputs.cache-primary-key }} - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 if: ${{ !cancelled() && matrix.target == 'x86_64-unknown-linux-gnu' }} with: diff --git a/.github/workflows/mobile.yml b/.github/workflows/mobile.yml index 67a44bdf..7e2f90f5 100644 --- a/.github/workflows/mobile.yml +++ b/.github/workflows/mobile.yml @@ -42,6 +42,8 @@ jobs: with: targets: aarch64-linux-android,x86_64-linux-android - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 + with: + save-if: ${{ github.ref == 'refs/heads/main' }} - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 with: version: 11.9.0 @@ -93,6 +95,7 @@ jobs: targets: aarch64-apple-ios,aarch64-apple-ios-sim,wasm32-unknown-unknown - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 with: + save-if: ${{ github.ref == 'refs/heads/main' }} cache-on-failure: true key: native-targets-${{ hashFiles('scripts/release-rustflags.py') }} workspaces: | @@ -135,7 +138,7 @@ jobs: # Only an app built from the committed sources, including the regenerated bindings, may be cached. test -z "$(git status --porcelain --untracked-files=normal)" - name: Save the simulator app for the same inputs - if: steps.app_cache.outputs.cache-hit != 'true' + if: steps.app_cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/main' uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 with: path: .artifacts/native/ios-build/Build/Products/Release-iphonesimulator/Vibeface.app diff --git a/.github/workflows/release-apps.yml b/.github/workflows/release-apps.yml index a189014f..53642179 100644 --- a/.github/workflows/release-apps.yml +++ b/.github/workflows/release-apps.yml @@ -36,6 +36,8 @@ jobs: with: targets: aarch64-linux-android,x86_64-linux-android - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 + with: + save-if: ${{ github.ref == 'refs/heads/main' }} - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 with: {version: 11.9.0} - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index 2c075ea3..216522eb 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -50,7 +50,7 @@ jobs: with: key: gpui-native-${{ inputs.target }} cache-on-failure: true - save-if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Test the native desktop features run: cargo test -p vibeface-desktop --features native-ui-tests --locked - name: Unpack the released runtime for this platform diff --git a/.github/workflows/release-ios.yml b/.github/workflows/release-ios.yml index ed138320..18a2339d 100644 --- a/.github/workflows/release-ios.yml +++ b/.github/workflows/release-ios.yml @@ -34,7 +34,9 @@ jobs: - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec with: {targets: 'aarch64-apple-ios,aarch64-apple-ios-sim'} - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 - with: {cache-on-failure: true} + with: + cache-on-failure: true + save-if: ${{ github.ref == 'refs/heads/main' }} - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 with: {version: 11.9.0} - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 diff --git a/.github/workflows/release-native.yml b/.github/workflows/release-native.yml index 97480fce..f236fedd 100644 --- a/.github/workflows/release-native.yml +++ b/.github/workflows/release-native.yml @@ -35,6 +35,8 @@ jobs: - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 with: key: ${{ runner.os == 'Windows' && 'windows-static-crt' || '' }} + # Tag runs restore main's caches but never save: a tag's cache serves only that tag. + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Select this platform's Python run: printf 'PY=%s\n' "$(command -v python3 || command -v python)" >> "$GITHUB_ENV" - uses: ./.github/actions/msvc-environment diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b0c089f..5f9fbba6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,6 +57,8 @@ jobs: - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec with: {targets: wasm32-unknown-unknown} - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 + with: + save-if: ${{ github.ref == 'refs/heads/main' }} - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 with: {version: 11.9.0} - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 From 4df4a8174b8ef15ba33f26a33f724ed780d9b326 Mon Sep 17 00:00:00 2001 From: cunoe Date: Thu, 12 Nov 2026 23:53:02 -0800 Subject: [PATCH 2/2] ci(release): keep the iOS archive as long as every other producer artifact Recovering a failed product release reruns its publishers from the original producer artifacts, and the Nightly coordinator refuses a recovery once any of them has expired. Every producer artifact uses the repository's 90-day retention except the iOS device archive, which set 14 days. A failed release left alone for two weeks could then never be recovered, and the coordinator keeps selecting it until an abandonment lands on main. Use the default retention for the iOS archive as well. --- .github/workflows/release-ios.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release-ios.yml b/.github/workflows/release-ios.yml index 18a2339d..a88afc02 100644 --- a/.github/workflows/release-ios.yml +++ b/.github/workflows/release-ios.yml @@ -110,4 +110,3 @@ jobs: .artifacts/ios/*.ipa.provenance.json .artifacts/ios/release.json if-no-files-found: error - retention-days: 14