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.yml b/.github/workflows/ci.yml index b10d1651..5fe820db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -238,7 +238,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 @@ -260,7 +262,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 }} @@ -285,7 +287,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 }} @@ -317,7 +319,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 }} @@ -352,7 +354,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 @@ -419,7 +421,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' 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 1aceb6bd..8ff5e6b0 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: Unpack the released runtime for this platform id: runtime env: diff --git a/.github/workflows/release-ios.yml b/.github/workflows/release-ios.yml index ed138320..a88afc02 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 @@ -108,4 +110,3 @@ jobs: .artifacts/ios/*.ipa.provenance.json .artifacts/ios/release.json if-no-files-found: error - retention-days: 14 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 49127a4f..bfbd6cba 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