This is an automated email from the ASF dual-hosted git repository.

prantogg pushed a commit to branch fix-cicd
in repository https://gitbox.apache.org/repos/asf/sedona-spatialbench.git

commit baa85e152f85903601daa0b2e8d24c028dc81ac5
Author: Pranav Toggi <prant...@gmail.com>
AuthorDate: Fri Sep 19 16:57:12 2025 -0700

    CI: fix caching; skip workflow for docs
---
 .github/workflows/rust.yml | 101 +++++++++++++++------------------------------
 1 file changed, 33 insertions(+), 68 deletions(-)

diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index f6bca63..5c64ec4 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -3,8 +3,22 @@ name: Rust
 on:
   push:
     branches: ["main"]
+    paths-ignore:
+      - 'docs/**'
+      - 'images/**'
+      - '*.md'
+      - '.github/workflows/rust.yml'
   pull_request:
-  workflow_dispatch:  # Allow manual triggering
+    paths-ignore:
+      - 'docs/**'
+      - 'images/**'
+      - '*.md'
+      - '.github/workflows/rust.yml'
+  workflow_dispatch:
+
+concurrency:
+  group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
+  cancel-in-progress: true
 
 env:
   CARGO_TERM_COLOR: always
@@ -18,16 +32,10 @@ jobs:
         uses: dtolnay/rust-toolchain@stable
         with:
           components: rustfmt, clippy
-      - name: Cache cargo registry and build artifacts
-        uses: actions/cache@v4
+      - uses: Swatinem/rust-cache@v2
         with:
-          path: |
-            ~/.cargo/registry
-            ~/.cargo/git
-            target
-          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
-          restore-keys: |
-            ${{ runner.os }}-cargo-
+          # Update this key to force a new cache
+          prefix-key: "rust-lint-v1"
       - name: Run cargo-fmt
         run: cargo fmt --all -- --check
       - name: Run cargo-clippy
@@ -41,81 +49,46 @@ jobs:
     needs: lint
     steps:
       - uses: actions/checkout@v4
-      - name: Setup Rust toolchain
-        uses: dtolnay/rust-toolchain@stable
-      - name: Cache cargo registry and build artifacts
-        uses: actions/cache@v4
+      - uses: dtolnay/rust-toolchain@stable
+      - uses: Swatinem/rust-cache@v2
         with:
-          path: |
-            ~/.cargo/registry
-            ~/.cargo/git
-            target
-          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
-          restore-keys: |
-            ${{ runner.os }}-cargo-
+          prefix-key: "rust-test-tests-spatialbench-v1"
       - name: Tests (spatialbench)
         run: cargo test -p spatialbench --tests
 
-  # doc examples test for spatialbench (takes a while)
   test-doc-spatialbench:
     runs-on: ubuntu-latest
     needs: lint
     steps:
       - uses: actions/checkout@v4
-      - name: Setup Rust toolchain
-        uses: dtolnay/rust-toolchain@stable
-      - name: Cache cargo registry and build artifacts
-        uses: actions/cache@v4
+      - uses: dtolnay/rust-toolchain@stable
+      - uses: Swatinem/rust-cache@v2
         with:
-          path: |
-            ~/.cargo/registry
-            ~/.cargo/git
-            target
-          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
-          restore-keys: |
-            ${{ runner.os }}-cargo-
+          prefix-key: "rust-test-doc-spatialbench-v1"
       - name: Doc Tests (spatialbench)
         run: cargo test -p spatialbench --doc
 
-  # All tests for spatialbench-arrow
   test-all-spatialbench-arrow:
     runs-on: ubuntu-latest
     needs: lint
     steps:
       - uses: actions/checkout@v4
-      - name: Setup Rust toolchain
-        uses: dtolnay/rust-toolchain@stable
-      - name: Cache cargo registry and build artifacts
-        uses: actions/cache@v4
+      - uses: dtolnay/rust-toolchain@stable
+      - uses: Swatinem/rust-cache@v2
         with:
-          path: |
-            ~/.cargo/registry
-            ~/.cargo/git
-            target
-          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
-          restore-keys: |
-            ${{ runner.os }}-cargo-
+          prefix-key: "rust-test-all-spatialbench-arrow-v1"
       - name: All Tests (spatialbench-arrow)
         run: cargo test -p spatialbench-arrow
 
-  # All tests for spatialbench-cli
   test-all-spatialbench-cli:
     runs-on: ubuntu-latest
     needs: lint
     steps:
       - uses: actions/checkout@v4
-      - name: Setup Rust toolchain
-        uses: dtolnay/rust-toolchain@stable
-      - name: Cache cargo registry and build artifacts
-        uses: actions/cache@v4
+      - uses: dtolnay/rust-toolchain@stable
+      - uses: Swatinem/rust-cache@v2
         with:
-          path: |
-            ~/.cargo/registry
-            ~/.cargo/git
-            target
-          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
-          restore-keys: |
-            ${{ runner.os }}-cargo-
+          prefix-key: "rust-test-all-spatialbench-cli-v1"
       - name: All Tests (spatialbench-cli)
         run: cargo test -p spatialbench-cli
 
@@ -125,18 +98,10 @@ jobs:
     needs: lint
     steps:
       - uses: actions/checkout@v4
-      - name: Setup Rust toolchain
-        uses: dtolnay/rust-toolchain@stable
-      - name: Cache cargo registry and build artifacts
-        uses: actions/cache@v4
+      - uses: dtolnay/rust-toolchain@stable
+      - uses: Swatinem/rust-cache@v2
         with:
-          path: |
-            ~/.cargo/registry
-            ~/.cargo/git
-            target
-          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
-          restore-keys: |
-            ${{ runner.os }}-cargo-
+          prefix-key: "rust-docs-v1"
       - name: Build docs
         env:
           RUSTDOCFLAGS: "-D warnings"

Reply via email to