From 014a94fe37fcf1d55df58ca4d01ac3f9755d6a76 Mon Sep 17 00:00:00 2001 From: Sky Date: Tue, 21 Nov 2023 15:24:58 -0500 Subject: [PATCH] deduplicate job count --- .github/workflows/ci.yml | 65 +++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c56fcb8..e672bfa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,51 +14,68 @@ env: jobs: clippy: - name: Clippy ${{matrix.rust-channel}} ${{matrix.os == 'windows' && '(windows)' || ''}} + name: Clippy ${{matrix.os == 'windows' && '(windows)' || ''}} runs-on: ${{matrix.os}}-latest timeout-minutes: 30 strategy: fail-fast: false matrix: - rust-channel: [stable, beta, nightly] os: [ubuntu, windows] steps: - name: Checkout Repository uses: actions/checkout@v4 - - name: Install Rust - uses: dtolnay/rust-toolchain@master + - name: Install Rust Stable + uses: dtolnay/rust-toolchain@stable + with: + components: clippy + + - name: Install Rust Beta + uses: dtolnay/rust-toolchain@beta + with: + components: clippy + + - name: Install Rust Nightly + uses: dtolnay/rust-toolchain@nightly with: - toolchain: ${{matrix.rust-channel}} components: clippy - - name: Clippy, Default Features - run: cargo clippy --all-targets - - name: Clippy, All Features - run: cargo clippy --all-features --all-targets - - name: Clippy, No Features - run: cargo clippy --no-default-features --all-targets + - name: Clippy (stable) + run: cargo +stable clippy --all-features --all-targets --workspace && cargo clean + - name: Clippy (beta) + run: cargo +beta clippy --all-features --all-targets --workspace && cargo clean + - name: Clippy (nightly) + run: cargo +nightly clippy --all-features --all-targets --workspace && cargo clean fmt: - name: Rustfmt ${{matrix.rust-channel}} + name: Rustfmt runs-on: ubuntu-latest timeout-minutes: 30 - strategy: - fail-fast: false - matrix: - rust-channel: [stable, beta, nightly] steps: - name: Checkout Repository uses: actions/checkout@v4 - - name: Install Rust - uses: dtolnay/rust-toolchain@master + - name: Install Rust Stable + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + + - name: Install Rust Beta + uses: dtolnay/rust-toolchain@beta + with: + components: rustfmt + + - name: Install Rust Nightly + uses: dtolnay/rust-toolchain@nightly with: - toolchain: ${{matrix.rust-channel}} components: rustfmt - - name: Check Formatting - run: cargo fmt --all --check + - name: Check Formatting (stable) + run: cargo +stable fmt --all --check + - name: Check Formatting (beta) + run: cargo +beta fmt --all --check + - name: Check Formatting (nightly) + run: cargo +nightly fmt --all --check test: name: Test ${{matrix.rust-channel}} ${{matrix.os == 'windows' && '(windows)' || ''}} @@ -79,8 +96,8 @@ jobs: toolchain: ${{matrix.rust-channel}} - name: Test Default Features - run: cargo test --all-targets + run: cargo test --all-targets --workspace - name: Test All Features - run: cargo test --all-features --all-targets + run: cargo test --all-features --all-targets --workspace - name: Test No Features - run: cargo test --no-default-features --all-targets + run: cargo test --no-default-features --all-targets --workspace