From 9fa4145d74c7c6e23ea98763dcf405dcd95aeb01 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Wed, 6 Dec 2023 20:00:52 +0100 Subject: [PATCH] ci: trim test matrix (#32) --- .github/workflows/ci.yml | 169 ++++++++++++++++++----------------- .github/workflows/deps.yml | 28 +++--- .github/workflows/sanity.yml | 6 +- 3 files changed, 102 insertions(+), 101 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cb289de..a78c43c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,93 +1,94 @@ name: CI on: - push: - branches: [main] - pull_request: + push: + branches: [main] + pull_request: jobs: - test: - name: test ${{ matrix.flags.name }} (${{ matrix.os }}) - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest", "macos-latest", "windows-latest"] - rust: ["stable", "beta", "nightly", "1.65"] - flags: ["--no-default-features", "", "--all-features"] - exclude: - # Skip because some features have highest MSRV. - - rust: "1.65" # MSRV - flags: "--all-features" - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - - name: Install test binaries - shell: bash - run: ./.github/scripts/install_test_binaries.sh - - name: Install nextest - uses: taiki-e/install-action@nextest - - uses: Swatinem/rust-cache@v2 - - name: build - if: ${{ matrix.rust == '1.65' }} # MSRV - run: cargo build --workspace ${{ matrix.flags }} - - name: test ${{ matrix.flags.flags }} - shell: bash - run: | - cargo nextest run \ - ${{ matrix.flags.flags }} \ - -E "!(kind(test))" \ - --retries 2 + test: + name: test ${{ matrix.flags.name }} (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + rust: ["stable", "1.65"] + flags: ["--no-default-features", "", "--all-features"] + exclude: + # Skip because some features have highest MSRV. + - rust: "1.65" # MSRV + flags: "--all-features" + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - name: Install test binaries + shell: bash + run: ./.github/scripts/install_test_binaries.sh + - name: Install nextest + uses: taiki-e/install-action@nextest + - uses: Swatinem/rust-cache@v2 + - name: build + if: matrix.rust == '1.65' # MSRV + run: cargo build --workspace ${{ matrix.flags }} + - name: test + if: matrix.rust != '1.65' # MSRV + shell: bash + run: | + cargo nextest run \ + ${{ matrix.flags.flags }} \ + -E "!(kind(test))" \ + --retries 2 - feature-checks: - name: feature checks - runs-on: ubuntu-latest - timeout-minutes: 45 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - - uses: taiki-e/install-action@cargo-hack - - uses: Swatinem/rust-cache@v2 - - name: cargo hack - run: cargo hack check --feature-powerset --depth 1 --all-targets + feature-checks: + name: feature checks + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - uses: taiki-e/install-action@cargo-hack + - uses: Swatinem/rust-cache@v2 + - name: cargo hack + run: cargo hack check --feature-powerset --depth 1 --all-targets - clippy: - name: clippy - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@clippy - - uses: Swatinem/rust-cache@v2 - - name: clippy - run: cargo clippy --workspace --all-features --all-targets - env: - RUSTFLAGS: "-D warnings" + clippy: + name: clippy + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@clippy + - uses: Swatinem/rust-cache@v2 + - name: clippy + run: cargo clippy --workspace --all-features --all-targets + env: + RUSTFLAGS: "-D warnings" - docs: - name: docs - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@nightly - with: - components: rust-docs - - uses: Swatinem/rust-cache@v2 - - name: doc - run: cargo doc --workspace --all-features --no-deps --document-private-items - env: - RUSTDOCFLAGS: "--cfg docsrs -D warnings" + docs: + name: docs + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly + with: + components: rust-docs + - uses: Swatinem/rust-cache@v2 + - name: doc + run: cargo doc --workspace --all-features --no-deps --document-private-items + env: + RUSTDOCFLAGS: "--cfg docsrs -D warnings" - fmt: - name: fmt - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@nightly - with: - components: rustfmt - - name: fmt --check - run: cargo fmt --all --check \ No newline at end of file + fmt: + name: fmt + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt + - name: fmt --check + run: cargo fmt --all --check diff --git a/.github/workflows/deps.yml b/.github/workflows/deps.yml index e96af9f3..1f711c8a 100644 --- a/.github/workflows/deps.yml +++ b/.github/workflows/deps.yml @@ -1,19 +1,19 @@ name: deps on: - push: - branches: [main] - pull_request: - branches: [main] - schedule: [cron: "00 00 * * *"] + push: + branches: [main] + pull_request: + branches: [main] + schedule: [cron: "00 00 * * *"] jobs: - cargo-deny: - name: cargo deny check - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v3 - - uses: EmbarkStudios/cargo-deny-action@v1 - with: - command: check all \ No newline at end of file + cargo-deny: + name: cargo deny check + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v3 + - uses: EmbarkStudios/cargo-deny-action@v1 + with: + command: check all diff --git a/.github/workflows/sanity.yml b/.github/workflows/sanity.yml index a31931cf..672b5260 100644 --- a/.github/workflows/sanity.yml +++ b/.github/workflows/sanity.yml @@ -2,7 +2,7 @@ on: workflow_dispatch: {} # Once per day at 00:00 UTC schedule: - - cron: '0 0 * * *' + - cron: "0 0 * * *" env: RUSTFLAGS: -D warnings @@ -30,8 +30,8 @@ jobs: if: ${{ failure() }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + WORKFLOW_URL: + ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} with: update_existing: true filename: .github/SANITY_UNUSED_DEPS_ISSUE_TEMPLATE.md -