From 22558274854b27aaff9ea8422ca31618d85bf009 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 18:40:47 +0000 Subject: [PATCH 1/2] ci: add cargo caching to pre-commit workflow Co-Authored-By: Jayant Krishnamurthy --- .github/workflows/ci-pre-commit.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci-pre-commit.yml b/.github/workflows/ci-pre-commit.yml index cd34e63720..200ab318ad 100644 --- a/.github/workflows/ci-pre-commit.yml +++ b/.github/workflows/ci-pre-commit.yml @@ -25,6 +25,17 @@ jobs: run: | rustup install 1.73.0 rustup install 1.66.1 + - name: Cache Rust dependencies + uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('.pre-commit-config.yaml') }}-1.82.0-1.73.0-1.66.1 + restore-keys: | + ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('.pre-commit-config.yaml') }}- + ${{ runner.os }}-cargo- - name: Install protoc uses: arduino/setup-protoc@v3 with: From ac799ea17c5fb8c02fe0e4f1eedf5436594a4535 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 18:59:21 +0000 Subject: [PATCH 2/2] ci: switch to rust-cache action for better caching - Replace manual cargo caching with Swatinem/rust-cache - Eliminates version management risk - Provides more sophisticated caching behavior Co-Authored-By: Jayant Krishnamurthy --- .github/workflows/ci-pre-commit.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/ci-pre-commit.yml b/.github/workflows/ci-pre-commit.yml index 200ab318ad..5fabb73b15 100644 --- a/.github/workflows/ci-pre-commit.yml +++ b/.github/workflows/ci-pre-commit.yml @@ -26,16 +26,7 @@ jobs: rustup install 1.73.0 rustup install 1.66.1 - name: Cache Rust dependencies - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('.pre-commit-config.yaml') }}-1.82.0-1.73.0-1.66.1 - restore-keys: | - ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('.pre-commit-config.yaml') }}- - ${{ runner.os }}-cargo- + uses: Swatinem/rust-cache@v2 - name: Install protoc uses: arduino/setup-protoc@v3 with: