From ceb28eea53b82a6a0425c13aeb68abddfe0e8e4b Mon Sep 17 00:00:00 2001 From: gera Date: Thu, 22 Aug 2024 13:28:40 +0200 Subject: [PATCH] append cargo hash to cache key --- .github/workflows/check-code.yml | 15 ++++----------- .github/workflows/publish-rustdocs.yml | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/check-code.yml b/.github/workflows/check-code.yml index 7b2ffbc69..0fd768f8a 100644 --- a/.github/workflows/check-code.yml +++ b/.github/workflows/check-code.yml @@ -53,7 +53,7 @@ jobs: ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ - key: ${{ github.job }}-${{ github.ref }}-${{ matrix.features }} + key: ${{ github.job }}-${{ github.ref }}-${{ matrix.features }}-${{ hashFiles('**/Cargo.lock') }} - name: Run `cargo clippy` run: | @@ -77,13 +77,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - # Latest 1.74 nightly release - toolchain: nightly-2023-10-01 - components: rustfmt - - name: Run `cargo fmt` run: cargo fmt -- --check @@ -159,7 +152,7 @@ jobs: ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ - key: ${{ github.job }}-${{ github.ref }}-${{ matrix.features }} + key: ${{ github.job }}-${{ github.ref }}-${{ matrix.features }}-${{ hashFiles('**/Cargo.lock') }} - name: Run `cargo test` run: | @@ -199,7 +192,7 @@ jobs: ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ - key: ${{ github.job }}-${{ github.ref }} + key: ${{ github.job }}-${{ github.ref }}-${{ hashFiles('**/Cargo.lock') }} - name: Run `cargo doc` run: | @@ -244,7 +237,7 @@ jobs: ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ - key: ${{ github.job }}-${{ github.ref }} + key: ${{ github.job }}-${{ github.ref }}-${{ hashFiles('**/Cargo.lock') }} - name: Install try-runtime run: | diff --git a/.github/workflows/publish-rustdocs.yml b/.github/workflows/publish-rustdocs.yml index 4b6a3ba02..14bf0b049 100644 --- a/.github/workflows/publish-rustdocs.yml +++ b/.github/workflows/publish-rustdocs.yml @@ -30,7 +30,7 @@ jobs: ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ - key: ${{ github.job }}-${{ github.ref }} + key: ${{ github.job }}-${{ github.ref }}-${{ hashFiles('**/Cargo.lock') }} - name: Run `cargo doc` run: |