name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
msrv:
name: MSRV (1.70)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.70"
- uses: Swatinem/rust-cache@v2
- run: cargo check --all-features
check:
name: ${{ matrix.toolchain }} / ${{ matrix.task }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: [stable, nightly]
task: [check, test, clippy, doc]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
- uses: Swatinem/rust-cache@v2
- name: cargo check
if: matrix.task == 'check'
run: cargo check --all-features
- name: cargo test
if: matrix.task == 'test'
run: cargo test --all-features
- name: cargo clippy
if: matrix.task == 'clippy'
run: >
cargo clippy --all-features -- -D warnings
- name: cargo doc
if: matrix.task == 'doc'
run: cargo doc --all-features --no-deps
env:
RUSTDOCFLAGS: -D warnings
coverage:
name: Code coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-llvm-cov
- run: cargo llvm-cov --all-features --lcov --output-path lcov.info
- uses: codecov/codecov-action@v4
with:
files: lcov.info
fail_ci_if_error: false