Cache the CI better
@@ -16,16 +16,7 @@ jobs:
toolchain: ${{ matrix.toolchain }}
override: true
- uses: actions/checkout@v2
- - name: Cache cargo registry
- uses: actions/cache@v1
- with:
- path: ~/.cargo/registry
- key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
- - name: Cache cargo index
- uses: actions/cache@v1
- with:
- path: ~/.cargo/git
- key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }}
+ - uses: Swatinem/rust-cache@v1
- name: Build
run: cargo build --verbose
continue-on-error: ${{ matrix.toolchain != 'stable' }}
@@ -48,21 +39,7 @@ jobs:
components: clippy
- name: Checkout sources
uses: actions/checkout@v2
- - name: Cache cargo registry
- uses: actions/cache@v1
- with:
- path: ~/.cargo/registry
- key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
- - name: Cache cargo index
- uses: actions/cache@v1
- with:
- path: ~/.cargo/git
- key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }}
- - name: Cache cargo build
- uses: actions/cache@v1
- with:
- path: target
- key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
+ - uses: Swatinem/rust-cache@v1
- name: Cargo Clippy
run: cargo clippy -- -D warnings -A deprecated
