name: CI
on:
  pull_request:
    branches: [main]
env:
  CARGO_TERM_COLOR: always
jobs:
  check:
    name: Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: jdx/mise-action@v2
      - uses: Swatinem/rust-cache@v2
      # Self-heal a cache-restored minimal-profile toolchain: a cached rustup
      # without these components otherwise fails the clippy step with
      # "'cargo-clippy' is not installed" (recurrent flake — the components
      # requested in mise.toml don't survive every cache round-trip).
      # Idempotent and ~2s when the components are already present.
      - run: rustup component add clippy rustfmt
      - run: cargo clippy --all-targets --all-features -- -D warnings
      # The full feature matrix, or the fjall/rocksdb conformance suites and
      # the transport tier silently skip (default features exclude them all).
      # Integration tests boot real nats-server + minio binaries (installed
      # above via mise — no Docker).
      - run: cargo test --lib --tests --features fjall,rocksdb,transport
      # The default-features surface consumers without the optional backends
      # actually compile against.
      - run: cargo test --lib --tests
