Skip to content

Commit

Permalink
ci: trim test matrix (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Dec 6, 2023
1 parent d8506a6 commit 9fa4145
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 101 deletions.
169 changes: 85 additions & 84 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
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
28 changes: 14 additions & 14 deletions .github/workflows/deps.yml
Original file line number Diff line number Diff line change
@@ -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
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
6 changes: 3 additions & 3 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 9fa4145

Please sign in to comment.