diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 00486aaf1af..ba2092ccb35 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -19,14 +19,8 @@ jobs: profile: minimal override: true - - name: Setup cache - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target/debug - key: ${{ runner.os }}-docs-rustc-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }} + - name: Cache dependencies + uses: Swatinem/rust-cache@v1 - name: Build docs env: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f82a0507728..7cea4d76d0a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,14 +20,8 @@ jobs: profile: minimal override: true - - name: Setup cache - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-clippy-rustc-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }} + - name: Cache dependencies + uses: Swatinem/rust-cache@v1 - name: Run clippy uses: actions-rs/clippy-check@v1 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0a289477276..20076ccba6b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,14 +22,8 @@ jobs: profile: minimal override: true - - name: Setup cache - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target/debug - key: ${{ runner.os }}-docs-rustc-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }} + - name: Cache dependencies + uses: Swatinem/rust-cache@v1 - name: Build docs env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a60764d62a8..c370a58fec6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,14 +22,8 @@ jobs: profile: minimal override: true - - name: Setup cache - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-test-rustc-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }} + - name: Cache dependencies + uses: Swatinem/rust-cache@v1 - name: Run cargo test run: cargo test @@ -88,14 +82,8 @@ jobs: profile: minimal override: true - - name: Setup cache - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-test-rustc-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }} + - name: Cache dependencies + uses: Swatinem/rust-cache@v1 - name: Test ${{ matrix.package }} feat. ${{ matrix.features }} working-directory: ${{ matrix.package }} @@ -119,14 +107,8 @@ jobs: profile: minimal override: true - - name: Setup cache - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-msrv-${{ steps.tc.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }} + - name: Cache dependencies + uses: Swatinem/rust-cache@v1 - run: cargo check --examples --tests --all-features env: