From ee84bfc5501d35247eaaf3250f3d99e07982e07a Mon Sep 17 00:00:00 2001 From: Cameron Garnham Date: Tue, 16 Jul 2024 22:29:45 +0200 Subject: [PATCH] ci: update workflows --- .github/workflows/coverage.yaml | 4 +-- .github/workflows/testing.yaml | 57 ++++++++++++++++++--------------- 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 441a77e66..68889266f 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -19,7 +19,7 @@ jobs: steps: - id: checkout name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - id: setup name: Setup Toolchain @@ -46,7 +46,7 @@ jobs: - id: upload name: Upload Coverage Report - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} files: ${{ steps.coverage.outputs.report }} diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index 8f583238f..eb2551699 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -15,7 +15,7 @@ jobs: steps: - id: checkout name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - id: setup name: Setup Toolchain @@ -39,71 +39,76 @@ jobs: strategy: matrix: - toolchain: [stable, nightly] + toolchain: [nightly, stable] steps: - id: checkout name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - id: setup name: Setup Toolchain uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly + toolchain: ${{ matrix.toolchain }} components: clippy - id: cache name: Enable Workflow Cache uses: Swatinem/rust-cache@v2 + - id: tools + name: Install Tools + uses: taiki-e/install-action@v2 + with: + tool: cargo-machete + - id: check name: Run Build Checks - run: cargo check --workspace --all-targets --all-features + run: cargo check --tests --benches --examples --workspace --all-targets --all-features - id: lint name: Run Lint Checks - run: cargo clippy --workspace --all-targets --all-features -- -D clippy::correctness -D clippy::suspicious + run: cargo clippy --tests --benches --examples --workspace --all-targets --all-features -- -D clippy::correctness -D clippy::suspicious -D clippy::complexity -D clippy::perf -D clippy::style -D clippy::pedantic - - id: doc - name: Run Documentation Checks - run: cargo test --doc + - id: docs + name: Lint Documentation + env: + RUSTDOCFLAGS: "-D warnings" + run: cargo doc --no-deps --bins --examples --workspace --all-features + + - id: deps + name: Check Unused Dependencies + run: cargo machete --with-metadata - internal: - name: Units and Integrations + unit: + name: Units runs-on: ubuntu-latest needs: check strategy: matrix: - toolchain: [stable, nightly] + toolchain: [nightly, stable] steps: - id: checkout name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - id: setup name: Setup Toolchain uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ matrix.toolchain }} - components: llvm-tools-preview - id: cache name: Enable Job Cache uses: Swatinem/rust-cache@v2 - - id: test - name: Run Code Tests - run: cargo test --workspace --all-targets --all-features - - - id: tools - name: Install Coverage Tools - uses: taiki-e/install-action@v2 - with: - tool: cargo-llvm-cov, cargo-nextest + - id: test-docs + name: Run Documentation Tests + run: cargo test --doc - - id: coverage - name: Generate Coverage Report - run: cargo llvm-cov nextest --workspace --all-targets --all-features + - id: test + name: Run Unit Tests + run: cargo test --tests --benches --examples --workspace --all-targets --all-features