Skip to content

Commit 7c2066f

Browse files
committed
Use lockfile for cache key
1 parent ed413af commit 7c2066f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/actions/setup-builder/action.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,17 @@ runs:
3737
/usr/local/cargo/registry/index/
3838
/usr/local/cargo/registry/cache/
3939
/usr/local/cargo/git/db/
40-
key: cargo-cache3-
40+
key: cargo-cache3-${{ hashFiles('**/Cargo.toml') }}
41+
- name: Generate lockfile
42+
shell: bash
43+
run: cargo fetch
4144
- name: Cache Rust dependencies
4245
uses: actions/cache@v3
4346
with:
4447
# these represent compiled steps of both dependencies and arrow
4548
# and thus are specific for a particular OS, arch and rust version.
4649
path: /github/home/target
47-
key: ${{ runner.os }}-${{ runner.arch }}-target-cache3-${{ inputs.rust-version }}-
50+
key: ${{ runner.os }}-${{ runner.arch }}-target-cache3-${{ inputs.rust-version }}-${{ hashFiles('**/Cargo.lock') }}
4851
- name: Install Build Dependencies
4952
shell: bash
5053
run: |
@@ -56,5 +59,4 @@ runs:
5659
echo "Installing ${{ inputs.rust-version }}"
5760
rustup toolchain install ${{ inputs.rust-version }}
5861
rustup default ${{ inputs.rust-version }}
59-
rustup component add rustfmt
6062
echo "CARGO_TARGET_DIR=/github/home/target" >> $GITHUB_ENV

0 commit comments

Comments
 (0)