From 570ddd2677e1f078e0ff8991357e76c2b70464d0 Mon Sep 17 00:00:00 2001 From: baptiste0928 <22115890+baptiste0928@users.noreply.github.com> Date: Mon, 6 Sep 2021 11:09:28 +0200 Subject: [PATCH 1/2] Improve CI cache --- .github/workflows/doc.yml | 10 ++-------- .github/workflows/lint.yml | 10 ++-------- .github/workflows/publish.yml | 10 ++-------- .github/workflows/test.yml | 30 ++++++------------------------ 4 files changed, 12 insertions(+), 48 deletions(-) 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: From 0b5181d64f029b59f14facdbd08a66e0b9109c82 Mon Sep 17 00:00:00 2001 From: baptiste0928 <22115890+baptiste0928@users.noreply.github.com> Date: Mon, 6 Sep 2021 11:44:56 +0200 Subject: [PATCH 2/2] Trigger CI An empty commit to trigger CI and ensure the cache works well.