Skip to content

Commit 7142dff

Browse files
committed
Use lockfile for cache key
Don't install unused components
1 parent ed413af commit 7142dff

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

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

+7-3
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,19 @@ 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+
restore-keys: cargo-cache3-
42+
- name: Generate lockfile
43+
shell: bash
44+
run: cargo fetch
4145
- name: Cache Rust dependencies
4246
uses: actions/cache@v3
4347
with:
4448
# these represent compiled steps of both dependencies and arrow
4549
# and thus are specific for a particular OS, arch and rust version.
4650
path: /github/home/target
47-
key: ${{ runner.os }}-${{ runner.arch }}-target-cache3-${{ inputs.rust-version }}-
51+
key: ${{ runner.os }}-${{ runner.arch }}-target-cache3-${{ inputs.rust-version }}-${{ hashFiles('**/Cargo.lock') }}
52+
restore-keys: ${{ runner.os }}-${{ runner.arch }}-target-cache3-${{ inputs.rust-version }}-
4853
- name: Install Build Dependencies
4954
shell: bash
5055
run: |
@@ -56,5 +61,4 @@ runs:
5661
echo "Installing ${{ inputs.rust-version }}"
5762
rustup toolchain install ${{ inputs.rust-version }}
5863
rustup default ${{ inputs.rust-version }}
59-
rustup component add rustfmt
6064
echo "CARGO_TARGET_DIR=/github/home/target" >> $GITHUB_ENV

.github/workflows/rust.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ jobs:
164164
run: |
165165
rustup toolchain install ${{ matrix.rust }}
166166
rustup default ${{ matrix.rust }}
167-
rustup component add rustfmt
168167
- name: Run tests
169168
shell: bash
170169
run: |
@@ -198,7 +197,7 @@ jobs:
198197
rust-version: ${{ matrix.rust }}
199198
- name: Setup Clippy
200199
run: |
201-
rustup component add rustfmt clippy
200+
rustup component add clippy
202201
- name: Run clippy
203202
run: |
204203
cargo clippy --features test_common --features prettyprint --features=async --all-targets --workspace -- -D warnings
@@ -258,7 +257,6 @@ jobs:
258257
run: |
259258
rustup toolchain install ${{ matrix.rust }}
260259
rustup default ${{ matrix.rust }}
261-
rustup component add rustfmt clippy
262260
- name: Cache Cargo
263261
uses: actions/cache@v3
264262
with:
@@ -321,7 +319,6 @@ jobs:
321319
run: |
322320
rustup toolchain install ${{ matrix.rust }}
323321
rustup override set ${{ matrix.rust }}
324-
rustup component add rustfmt
325322
rustup target add wasm32-unknown-unknown
326323
rustup target add wasm32-wasi
327324
- name: Build arrow crate

0 commit comments

Comments
 (0)