Skip to content

Commit

Permalink
Use lockfile for cache key
Browse files Browse the repository at this point in the history
Don't install unused components
  • Loading branch information
tustvold committed Jun 9, 2022
1 parent ed413af commit 7142dff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 7 additions & 3 deletions .github/actions/setup-builder/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,19 @@ runs:
/usr/local/cargo/registry/index/
/usr/local/cargo/registry/cache/
/usr/local/cargo/git/db/
key: cargo-cache3-
key: cargo-cache3-${{ hashFiles('**/Cargo.toml') }}
restore-keys: cargo-cache3-
- name: Generate lockfile
shell: bash
run: cargo fetch
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
# these represent compiled steps of both dependencies and arrow
# and thus are specific for a particular OS, arch and rust version.
path: /github/home/target
key: ${{ runner.os }}-${{ runner.arch }}-target-cache3-${{ inputs.rust-version }}-
key: ${{ runner.os }}-${{ runner.arch }}-target-cache3-${{ inputs.rust-version }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ runner.arch }}-target-cache3-${{ inputs.rust-version }}-
- name: Install Build Dependencies
shell: bash
run: |
Expand All @@ -56,5 +61,4 @@ runs:
echo "Installing ${{ inputs.rust-version }}"
rustup toolchain install ${{ inputs.rust-version }}
rustup default ${{ inputs.rust-version }}
rustup component add rustfmt
echo "CARGO_TARGET_DIR=/github/home/target" >> $GITHUB_ENV
5 changes: 1 addition & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ jobs:
run: |
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
rustup component add rustfmt
- name: Run tests
shell: bash
run: |
Expand Down Expand Up @@ -198,7 +197,7 @@ jobs:
rust-version: ${{ matrix.rust }}
- name: Setup Clippy
run: |
rustup component add rustfmt clippy
rustup component add clippy
- name: Run clippy
run: |
cargo clippy --features test_common --features prettyprint --features=async --all-targets --workspace -- -D warnings
Expand Down Expand Up @@ -258,7 +257,6 @@ jobs:
run: |
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
rustup component add rustfmt clippy
- name: Cache Cargo
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -321,7 +319,6 @@ jobs:
run: |
rustup toolchain install ${{ matrix.rust }}
rustup override set ${{ matrix.rust }}
rustup component add rustfmt
rustup target add wasm32-unknown-unknown
rustup target add wasm32-wasi
- name: Build arrow crate
Expand Down

0 comments on commit 7142dff

Please sign in to comment.