Add a cache for linting as well
This is separate from the cache for the test workflow as cargo clippy doesn't necessarily create the same build artefacts. However, the restore-keys includes a partial key matching that of the test cache as a fall-back.
@@ -75,6 +75,19 @@ jobs:
components: rustfmt, clippy
target: ${{ matrix.target }}
+ - uses: actions/cache@v3
+ with:
+ path: |
+ ~/.cargo/bin/
+ ~/.cargo/registry/index/
+ ~/.cargo/registry/cache/
+ ~/.cargo/git/db/
+ target/
+ key: lint-${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
+ restore-keys: |
+ lint-${{ runner.os }}-cargo-${{ matrix.target }}-
+ ${{ runner.os }}-cargo-${{ matrix.target }}-
+
- name: cargo fmt
uses: actions-rs/cargo@v1
with:
