diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c3bdd8..cbe2889 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,13 +40,20 @@ jobs: - name: Install Rust toolchain if: steps.crates.outputs.exists == 'true' - uses: actions-rust-lang/setup-rust-toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.toolchain }} components: clippy, rustfmt - rustflags: "" - cache-shared-key: linux-quality - cache-save-if: ${{ github.ref == 'refs/heads/main' }} + - name: Restore Rust cache + if: steps.crates.outputs.exists == 'true' + uses: Swatinem/rust-cache@v2 + with: + shared-key: linux-quality + cache-targets: true + cache-all-crates: false + cache-workspace-crates: false + cache-bin: false + save-if: ${{ github.ref == 'refs/heads/main' }} cache-on-failure: false - name: Check formatting @@ -55,11 +62,11 @@ jobs: - name: Run Clippy if: steps.crates.outputs.exists == 'true' - run: cargo clippy --workspace --all-targets --all-features -- -D warnings + run: cargo clippy --locked --workspace --all-targets --all-features -- -D warnings - name: Run tests if: steps.crates.outputs.exists == 'true' - run: cargo test --workspace --all-targets --all-features + run: cargo test --locked --workspace --all-targets --all-features - name: Note docs-only branch if: steps.crates.outputs.exists == 'false' @@ -80,15 +87,20 @@ jobs: uses: actions/checkout@v7 - name: Install Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: stable components: clippy, rustfmt - rustflags: "" + - name: Restore Rust cache + uses: Swatinem/rust-cache@v2 + with: + shared-key: macro-runtime-${{ runner.os }} cache-targets: false + cache-all-crates: false + cache-workspace-crates: false cache-bin: false - cache-save-if: ${{ github.ref == 'refs/heads/main' }} + save-if: ${{ github.ref == 'refs/heads/main' }} cache-on-failure: false - name: Run opy-macro-js tests - run: cargo test -p opy-macro-js --all-targets + run: cargo test --locked -p opy-macro-js --all-targets