From b504ad83991b46c91861cf714d72c080dfeb5f6e Mon Sep 17 00:00:00 2001 From: geoffsee <> Date: Thu, 14 Aug 2025 16:56:43 -0400 Subject: [PATCH] Cache Cargo dependencies in CI workflows --- .github/workflows/ci.yml | 10 ++++++++++ .github/workflows/docs.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/release.yml | 20 ++++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa0cd4f..220fd4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,16 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Setup Rust run: rustup update stable && rustup default stable diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 10a0dc4..ca9b5a7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -48,6 +48,16 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Setup Rust run: rustup update stable && rustup default stable @@ -85,6 +95,16 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Setup Rust run: rustup update stable && rustup default stable @@ -115,6 +135,16 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Setup Rust run: rustup update stable && rustup default stable diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9efd80d..134beff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,6 +38,16 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Setup Rust run: rustup update stable && rustup default stable @@ -76,6 +86,16 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Setup Rust run: rustup update stable && rustup default stable