boostr 0.1.0

ML framework built on numr - attention, quantization, model architectures
Documentation
# Reusable test workflow: lint, format, docs, cross-platform tests, backend checks.
#
# Called by:
#   - ci.yml        (PR checks)
#   - release.yml   (via workflow_call)
#
# Not triggered directly — use workflow_call only.

name: Test

on:
  workflow_call:

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always

jobs:
  lint:
    name: Lint, Format & Docs
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy

      - uses: Swatinem/rust-cache@v2
        with:
          prefix-key: lint

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

      - name: Run clippy (all CI-safe features)
        run: cargo clippy --all-targets --features f16 -- -D warnings

      - name: Build docs
        run: cargo doc --no-deps --features f16

      - name: Run doctests
        run: cargo test --doc --features f16

  test:
    name: Test (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]

    steps:
      - uses: actions/checkout@v5

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - uses: Swatinem/rust-cache@v2
        with:
          prefix-key: test

      - name: Run tests (default)
        run: cargo test

      - name: Run tests (f16)
        run: cargo test --features f16

  backend-and-parity:
    name: Backend Compile & Parity
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - uses: Swatinem/rust-cache@v2
        with:
          prefix-key: backend-parity

      # Backend compile gates
      - name: "Compile: cpu-only (no default features)"
        run: cargo check --no-default-features --features cpu

      - name: "Compile: cpu + f16"
        run: cargo check --features f16

      - name: "Compile: wgpu"
        run: cargo check --features wgpu,f16

      - name: "Compile tests: cpu-only"
        run: cargo test --no-run --no-default-features --features cpu

      - name: "Compile tests: wgpu"
        run: cargo test --no-run --features wgpu,f16

      # Backend parity
      - name: Run backend parity tests
        run: cargo test backend_parity --features f16