diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index ca3ad0281..ce03b6e8e 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -28,4 +28,7 @@ jobs: with: components: clippy - uses: Swatinem/rust-cache@v2 + with: + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} - run: cargo clippy --all-targets -- -D warnings diff --git a/.github/workflows/integration-cassandra.yml b/.github/workflows/integration-cassandra.yml index 703372dd0..1f578bfee 100644 --- a/.github/workflows/integration-cassandra.yml +++ b/.github/workflows/integration-cassandra.yml @@ -65,6 +65,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Configure Cassandra authentication run: | docker exec ${{ job.services.cassandra.id }} sed -i \ @@ -121,6 +123,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Configure Cassandra authentication run: | docker exec ${{ job.services.cassandra.id }} sed -i \ @@ -172,6 +176,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Configure Cassandra authentication run: | docker exec ${{ job.services.cassandra.id }} sed -i \ @@ -208,6 +214,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Check production Cassandra feature graph run: cargo check --release --no-default-features --features cassandra diff --git a/.github/workflows/integration-mongodb.yml b/.github/workflows/integration-mongodb.yml index 03223f967..01e28552f 100644 --- a/.github/workflows/integration-mongodb.yml +++ b/.github/workflows/integration-mongodb.yml @@ -41,6 +41,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} - uses: actions/setup-python@v5 with: python-version: "3.11" @@ -64,6 +66,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Start replica set # Same bootstrap developers run locally; --mongo-only skips the # server and prints the URI. No pipe: a bootstrap failure must fail @@ -109,6 +113,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} - uses: actions/setup-python@v5 with: python-version: "3.11" @@ -128,6 +134,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Check production MongoDB feature graph run: cargo check --release --no-default-features --features mongodb diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index da6c251d3..b1de36c0b 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -54,6 +54,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Build release run: cargo build --release @@ -116,6 +118,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Build release (SQLite backend) run: cargo build --release -p extenddb --no-default-features --features sqlite @@ -178,6 +182,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Build release (dev mode, in-memory SQLite) run: cargo build --release -p extenddb --no-default-features --features sqlite-memory,dev-mode @@ -240,6 +246,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Build release run: cargo build --release @@ -354,6 +362,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Build release run: cargo build --release @@ -415,6 +425,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Build release (SQLite backend) run: cargo build --release -p extenddb --no-default-features --features sqlite diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index db09750f3..17f2a1d28 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,6 +34,9 @@ jobs: with: toolchain: ${{ matrix.toolchain }} - uses: Swatinem/rust-cache@v2 + with: + # Only pushes to main save, so other runs restore main's cache. + save-if: ${{ github.ref == 'refs/heads/main' }} # Local S3 endpoint for the backup-store conformance suite. moto is a # pip package, so it needs no container image; MinIO no longer