name: ci

on:
  push:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - name: Setup | Checkout
        uses: actions/checkout@v4

      - name: Setup | Toolchain
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: nightly-2025-10-01

      - name: Test
        run: cargo test
        env:
          RUST_BACKTRACE: full

  lint:
    runs-on: ubuntu-latest

    steps:
      - name: Setup | Checkout
        uses: actions/checkout@v4

      - name: Setup | Toolchain
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: nightly-2025-10-01
          components: rustfmt, clippy

      - name: Format
        run: cargo fmt --all -- --check

      - name: Clippy
        run: cargo clippy --all-targets --all-features -- -D warnings

      - name: Build docs
        run: cargo doc --no-deps --document-private-items
        env:
          RUSTDOCFLAGS: -D warnings
