From 2e71a3e0ff0327e35bcc77811dd68bdbf0a2ffb4 Mon Sep 17 00:00:00 2001 From: Diana Carvalho Date: Thu, 15 May 2025 15:44:41 +0100 Subject: [PATCH] ci: fix lint ci Took 1 minute --- .../workflows/tests-and-lints-template.yaml | 37 ++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/.github/workflows/tests-and-lints-template.yaml b/.github/workflows/tests-and-lints-template.yaml index 64665c4..6f85b08 100644 --- a/.github/workflows/tests-and-lints-template.yaml +++ b/.github/workflows/tests-and-lints-template.yaml @@ -59,9 +59,12 @@ jobs: git config --global url."https://x-access-token:${{ steps.generate-token.outputs.token }}@github.com".insteadOf ssh://github.com - name: Setup toolchain - uses: dtolnay/rust-toolchain@888c2e1ea69ab0d4330cbf0af1ecc7b68f368cc1 + id: toolchain + uses: actions-rs/toolchain@v1 with: - toolchain: ${{ matrix.toolchain }} + toolchain: nightly + components: rustfmt, clippy + override: true - name: Setup Rust Cache uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 @@ -100,28 +103,20 @@ jobs: echo "https://${{ steps.generate-token.outputs.token }}@github.com" > ~/.git-credentials git config --global url."https://x-access-token:${{ steps.generate-token.outputs.token }}@github.com".insteadOf ssh://github.com - - name: Setup clippy toolchain - stable - uses: dtolnay/rust-toolchain@888c2e1ea69ab0d4330cbf0af1ecc7b68f368cc1 + - name: Setup toolchain + id: toolchain + uses: actions-rs/toolchain@v1 with: - toolchain: stable - components: clippy - + toolchain: nightly + components: rustfmt, clippy + override: true - name: Setup Rust Cache - uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 + uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - - run: cargo +nightly clippy --workspace --lib --all-targets --all-features -- -D clippy::dbg-macro - env: - RUSTFLAGS: -Dwarnings + - name: Clippy + run: cargo clippy --workspace --all-targets --all-features - - run: cargo check --no-default-features - env: - RUSTFLAGS: -Dwarnings - - - name: Setup rustfmt toolchain - nightly - uses: dtolnay/rust-toolchain@a02741459ec5e501b9843ed30b535ca0a0376ae4 - with: - components: rustfmt - - - run: cargo +nightly fmt --all --check + - name: Rustfmt + run: cargo fmt --all --check