name: CI

on:
  - push
  - pull_request

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    name: Build, Format, Lint, and Test
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Check formatting
        run: cargo fmt --all -- --check

      - name: Build
        run: cargo build --verbose

      - name: Run clippy
        run: cargo clippy -- -D warnings

      - name: Run tests
        run: cargo test --verbose

      - name: Check documentation
        run: cargo doc --document-private-items
