name: CI

on:
  push:
    branches: [ main, master ]
  pull_request:
    branches: [ main, master ]

env:
  RUSTFLAGS: "-D warnings"

jobs:
  build-test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy,rustfmt
      - name: Verify formatting
        run: cargo fmt --all --check
      - name: Build (no_std default)
        run: cargo build --verbose
      - name: Clippy
        run: cargo clippy --all-targets -- -D warnings
      - name: Test (std feature)
        run: cargo test --features std --verbose
      - name: Docs
        run: cargo doc --no-deps

