name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
typos:
name: Check for typos
runs-on: ubuntu-latest
steps:
- name: Fetch repository
uses: actions/checkout@v4
- name: Check for typos
uses: crate-ci/typos@v1
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
needs: typos
steps:
- name: Fetch repository
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check
- name: Check for linting issues
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Check documentation builds
run: cargo doc --workspace --no-deps --document-private-items
- name: Run unit and integration tests
run: cargo test --all-targets --all-features
- name: Run documentation tests
run: cargo test --all-features --doc