test: increase coverage, improve test matrices for CI
This commit is contained in:
6 files changed
+245
-26
No files matched your search
+41
-16
@@ -12,7 +12,10 @@ env:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
name: Lint (${{ matrix.features }})
|
||||
strategy:
|
||||
matrix:
|
||||
features: ["--no-default-features", "--all-features", ""]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -21,14 +24,18 @@ jobs:
|
||||
with:
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Check formatting
|
||||
- name: Check formatting (once)
|
||||
if: matrix.features == ''
|
||||
run: cargo fmt -- --check
|
||||
|
||||
- name: Clippy
|
||||
run: cargo clippy --all-targets --all-features -- -D warnings
|
||||
run: cargo clippy --all-targets ${{ matrix.features }} -- -D warnings
|
||||
|
||||
msrv:
|
||||
name: MSRV Verification
|
||||
name: MSRV Verification (${{ matrix.features }})
|
||||
strategy:
|
||||
matrix:
|
||||
features: ["--no-default-features", "--all-features", ""]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -40,20 +47,16 @@ jobs:
|
||||
run: cargo install cargo-msrv
|
||||
|
||||
- name: Verify MSRV
|
||||
run: cargo msrv verify
|
||||
run: cargo msrv verify ${{ matrix.features }}
|
||||
|
||||
test:
|
||||
name: Test
|
||||
name: Test (${{ matrix.os }}, ${{ matrix.rust }}, ${{ matrix.features }})
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
rust: [stable, nightly]
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
rust: "1.81" # MSRV
|
||||
exclude:
|
||||
- rust: nightly
|
||||
|
||||
features: ["--no-default-features", "--all-features", ""]
|
||||
fail-fast: false
|
||||
runs-on: ${{ matrix.os }}
|
||||
continue-on-error: ${{ matrix.rust == 'nightly' }}
|
||||
|
||||
@@ -66,9 +69,28 @@ jobs:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: ${{ matrix.os }}-${{ matrix.rust }}-${{ hashFiles('matrix.features') }}
|
||||
|
||||
- name: Run tests
|
||||
run: cargo test --all-targets --all-features
|
||||
run: cargo test --all-targets ${{ matrix.features }}
|
||||
|
||||
check:
|
||||
name: Cargo Check (${{ matrix.features }})
|
||||
strategy:
|
||||
matrix:
|
||||
features: ["--no-default-features", "--all-features", ""]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Cargo check
|
||||
run: cargo check ${{ matrix.features }}
|
||||
|
||||
examples:
|
||||
name: Examples
|
||||
@@ -100,7 +122,7 @@ jobs:
|
||||
run: cargo install cargo-tarpaulin
|
||||
|
||||
- name: Generate code coverage
|
||||
run: cargo tarpaulin --out Xml --out Lcov --output-dir coverage --fail-under 90
|
||||
run: cargo tarpaulin --lib --all-features --out Xml --out Lcov --output-dir coverage --fail-under 88
|
||||
|
||||
security:
|
||||
name: Security Audit
|
||||
@@ -118,7 +140,10 @@ jobs:
|
||||
run: cargo audit
|
||||
|
||||
doc:
|
||||
name: Documentation
|
||||
name: Documentation (${{ matrix.features }})
|
||||
strategy:
|
||||
matrix:
|
||||
features: ["--no-default-features", "--all-features", ""]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -127,4 +152,4 @@ jobs:
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Build documentation
|
||||
run: cargo doc --no-deps --document-private-items
|
||||
run: cargo doc --no-deps ${{ matrix.features }}
|
||||
Reference in new issue
Block a user