Add some more caching to CI

Use cacing in a few more places, replace the manual caching by the
action to simplify.
This commit is contained in:
Floris Bruynooghe
2021-12-24 16:59:39 +01:00
parent d47680733b
commit 6859b651a8

View File

@@ -21,6 +21,8 @@ jobs:
toolchain: stable toolchain: stable
override: true override: true
- run: rustup component add rustfmt - run: rustup component add rustfmt
- name: Cache rust cargo artifacts
uses: swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
with: with:
command: fmt command: fmt
@@ -35,6 +37,8 @@ jobs:
toolchain: stable toolchain: stable
components: clippy components: clippy
override: true override: true
- name: Cache rust cargo artifacts
uses: swatinem/rust-cache@v1
- uses: actions-rs/clippy-check@v1 - uses: actions-rs/clippy-check@v1
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -94,23 +98,8 @@ jobs:
toolchain: ${{ matrix.rust }} toolchain: ${{ matrix.rust }}
override: true override: true
- name: Cache cargo registry - name: Cache rust cargo artifacts
uses: actions/cache@v2 uses: swatinem/rust-cache@v1
with:
path: ~/.cargo/registry
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}
- name: Cache cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}
- name: check - name: check
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1