diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b1923f7..49a1c4a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -3,7 +3,7 @@ name: Rust on: push: branches: [main] - paths: ["**/*.rs", "**/Cargo.toml", "**/Cargo.lock", ".github/*.yml"] + paths: ["**/*.rs", "**/Cargo.toml", "**/Cargo.lock", ".github/**/*.yml"] pull_request: branches: [main] paths: ["**/*.rs", "**/Cargo.toml", "**/Cargo.lock"] @@ -33,6 +33,10 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: toolchain: stable + - uses: Swatinem/rust-cache@v2 + with: + shared-key: "build-cache" + save-if: ${{ github.ref == 'refs/heads/master' }} - run: cargo check --no-default-features --features=${{ matrix.features}} clippy: @@ -47,6 +51,10 @@ jobs: with: toolchain: stable components: clippy + - uses: Swatinem/rust-cache@v2 + with: + shared-key: "build-cache" + save-if: ${{ github.ref == 'refs/heads/master' }} - run: cargo clippy --no-default-features --features=${{ matrix.features}} test: @@ -60,4 +68,8 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: toolchain: stable + - uses: Swatinem/rust-cache@v2 + with: + shared-key: "build-cache" + save-if: ${{ github.ref == 'refs/heads/master' }} - run: cargo test --no-default-features --features=${{ matrix.features}}