parse-net 0.2.0

Grammar for Internet message fields: RFC 9110 field syntax, media types, RFC 9651 Structured Fields, HTTP and RFC 5322 dates, negotiation, entity tags, ranges, Content-Disposition, Cache-Control, Forwarded, auth challenges, and the email lexical layer. no_std, no allocation, sans-IO, zero dependencies.
Documentation
name: CI

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

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: "-D warnings"
  # Run every JS action on Node.js 24 ahead of GitHub's forced migration,
  # silencing "Node.js 20 actions are deprecated" runner warnings.
  FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"

jobs:
  test:
    name: Test (${{ matrix.os }} / ${{ matrix.rust }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        rust: [stable, "1.85"]
    steps:
      - uses: actions/checkout@v5
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}
          components: clippy, rustfmt
      - uses: Swatinem/rust-cache@v2
      - name: Format
        run: cargo fmt --all -- --check
      - name: Clippy (default features)
        run: cargo clippy --all-targets -- -D warnings
      - name: Clippy (all features)
        run: cargo clippy --all-targets --all-features -- -D warnings
      - name: Clippy (no default features)
        run: cargo clippy --all-targets --no-default-features -- -D warnings
      - name: Test (default features)
        run: cargo test
      - name: Test (all features)
        run: cargo test --all-features
      - name: Test (no default features)
        run: cargo test --no-default-features
      - name: Build examples
        run: cargo build --examples
      # Both modes: a doc link to a feature-gated item breaks only when that
      # feature is off (dev/PLAN.md, D-014).
      - name: Doc (default features)
        run: cargo doc --no-deps
        env:
          RUSTDOCFLAGS: "-D warnings"
      - name: Doc (all features)
        run: cargo doc --no-deps --all-features
        env:
          RUSTDOCFLAGS: "-D warnings"

  no-std:
    name: Bare metal (thumbv7em-none-eabi / ${{ matrix.rust }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        rust: [stable, "1.85"]
    steps:
      - uses: actions/checkout@v5
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}
          targets: thumbv7em-none-eabi
          components: clippy
      - uses: Swatinem/rust-cache@v2
        with:
          key: thumbv7em
      # A target with no `std` at all proves the core never reaches for it
      # (dev/PLAN.md, NFR-5). `alloc` builds there too.
      - name: Build (no features)
        run: cargo build --target thumbv7em-none-eabi --no-default-features
      - name: Build (alloc)
        run: cargo build --target thumbv7em-none-eabi --no-default-features --features alloc
      - name: Clippy (no features)
        run: cargo clippy --target thumbv7em-none-eabi --no-default-features -- -D warnings

  zero-deps:
    name: Zero runtime dependencies
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: dtolnay/rust-toolchain@stable
      - name: The default build depends on nothing
        shell: bash
        run: |
          set -euo pipefail
          # `cargo tree -e normal` prints the crate itself and nothing under it
          # when the default build has no runtime dependencies (NFR-14).
          tree=$(cargo tree -e normal --prefix none)
          lines=$(printf '%s\n' "$tree" | grep -c . || true)
          if [ "$lines" -ne 1 ]; then
            echo "parse-net must have zero runtime dependencies in its default build (dev/PLAN.md, D-001)."
            printf '%s\n' "$tree"
            exit 1
          fi
          echo "$tree"

  package:
    name: Package
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - name: Package
        run: cargo package

  security:
    name: Security (audit + deny)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - name: Install cargo-audit and cargo-deny
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-audit,cargo-deny
      - name: Generate lockfile
        run: cargo generate-lockfile
      - name: Audit
        run: cargo audit
      - name: Deny
        run: cargo deny check