Restore cache before running cargo fmt

It appears cargo fmt also downloads the git dependencies which takes quite a while. The cache should contain a copy of the cloned repo, so restoring the cache early should speed things up.
This commit is contained in:
Arthur Baars
2020-11-09 13:52:12 +01:00
parent 6f72ba106e
commit 81ceb22b14

View File

@@ -23,15 +23,15 @@ jobs:
- name: Install rustfmt
run: rustup component add rustfmt --toolchain stable-x86_64-apple-darwin
if: ${{ matrix.os == 'macos-latest' }}
- name: Check formatting
run: cargo fmt --all -- --check
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-rust-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: cargo fmt --all -- --check
- name: Build
run: cargo build --verbose
- name: Run tests