on: [push, pull_request]
name: Continuous integration
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt
- run: cargo fmt --all -- --check
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- 1.75.0
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
- name: Resolve dependencies for MSRV
run: |
mkdir -p $HOME/.cargo
echo 'resolver.incompatible-rust-versions = "fallback"' > $HOME/.cargo/config.toml
cargo +stable update
- name: Library default build check
run: cargo +${{ matrix.rust }} check
- name: Tokio build check
run: cargo +${{ matrix.rust }} check --all-targets --features=tokio,utils
- name: smol build check
run: cargo +${{ matrix.rust }} check --all-targets --features=smol,utils
- name: Doc generation
run: cargo +${{ matrix.rust }} doc --no-deps
- name: Run tests
run: cargo +${{ matrix.rust }} test
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
components: clippy
- name: Resolve dependencies for MSRV
run: |
mkdir -p $HOME/.cargo
echo 'resolver.incompatible-rust-versions = "fallback"' > $HOME/.cargo/config.toml
cargo +stable update
- name: Run clippy
run: cargo +1.75.0 clippy -- -D warnings