modify cache keys to incorporate rust version (#8762)

* modify cache keys to incorporate rust version

* Update .github/actions/cache/action.yml

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>

---------

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
This commit is contained in:
Paul Kehrer 2023-04-20 18:17:26 -06:00 committed by GitHub
parent f26dcee04d
commit 7af92f2ffb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -19,6 +19,10 @@ runs:
using: "composite"
steps:
- name: Get rust version
id: rust-version
run: echo "version=$(rustc --version | sha256sum | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
shell: bash
- name: Get pip cache dir
id: pip-cache
run: |
@ -39,7 +43,7 @@ runs:
~/.cargo/registry/cache/
src/rust/target/
${{ inputs.additional-paths }}
key: cargo-pip-${{ runner.os }}-${{ runner.arch }}-${{ inputs.key }}-3-${{ hashFiles('**/Cargo.lock') }}
key: cargo-pip-${{ runner.os }}-${{ runner.arch }}-${{ inputs.key }}-3-${{ hashFiles('**/Cargo.lock') }}-${{ steps.rust-version.version }}
- name: Size of cache items
run: |
du -sh ~/.cargo/registry/index/

View file

@ -219,8 +219,6 @@ jobs:
- name: Cache rust and pip
uses: ./.github/actions/cache
timeout-minutes: 2
with:
key: ${{ matrix.RUST }}
- name: Setup python
uses: actions/setup-python@v4.6.0
with:
@ -275,7 +273,7 @@ jobs:
uses: ./.github/actions/cache
timeout-minutes: 2
with:
key: ${{ steps.rust-toolchain.outputs.cachekey }}-coverage
key: coverage
additional-paths: |
~/.cargo/bin/cargo-cov
~/.cargo/bin/cargo-nm