creature_feature 0.2.0

Composable n-gram combinators that are ergonomic and bare-metal fast.
Documentation
name: CI

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

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: test (stable)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - name: build
        run: cargo build --all-targets
      - name: test (default features)
        run: cargo test
      - name: test (serde1)
        run: cargo test --features serde1
      - name: test (serde1 + heapless)
        run: cargo test --features serde1,heapless

  lint:
    name: fmt + clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - uses: Swatinem/rust-cache@v2
      - name: rustfmt
        run: cargo fmt --all -- --check
      - name: clippy
        run: cargo clippy --all-targets --all-features -- -D warnings

  msrv:
    name: MSRV (1.65)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@1.65
      - uses: Swatinem/rust-cache@v2
      # The MSRV contract is that the library's own source compiles on 1.65 with
      # default features. `cargo build` (lib only) does not compile dev-deps, so
      # this is immune to the bench's `criterion` tree. Running the test suite at
      # 1.65 additionally works with default features (verified locally against a
      # criterion-free lock), but older cargo eagerly compiles the criterion
      # dev-dependency for `cargo test`, so test-at-MSRV isn't run in CI without a
      # criterion-free setup. The optional `serde1`/`heapless` features pull
      # transitive deps whose own MSRVs exceed 1.65; a 1.65 consumer enabling them
      # must pin those deps.
      - name: build (lib, default features)
        run: cargo build --lib