flowscope 0.24.1

Passive flow & session tracking for packet capture (runtime-free, cross-platform)
Documentation
name: CI
on:
  push:
    branches: [master]
  pull_request:

concurrency:
  group: ci-${{ github.ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always
  # shared compiler cache: sccache (mounted from the runner VM) -> garage S3
  # on vm-runner-01; S3 endpoint+credentials come from the runner's env_file
  RUSTC_WRAPPER: /srv/cache/bin/sccache
  CARGO_INCREMENTAL: "0"

jobs:
  fmt:
    runs-on: ubuntu-24.04
    steps:
      - uses: https://data.forgejo.org/actions/checkout@v6
      - uses: https://github.com/dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - run: cargo fmt --all --check

  clippy:
    runs-on: ubuntu-24.04
    steps:
      - uses: https://data.forgejo.org/actions/checkout@v6
      - uses: https://github.com/dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - uses: https://github.com/Swatinem/rust-cache@v2
        with:
          cache-targets: false
      - run: cargo clippy --all-features --all-targets --locked -- -D warnings

  test:
    runs-on: ubuntu-24.04
    steps:
      - uses: https://data.forgejo.org/actions/checkout@v6
      - uses: https://github.com/dtolnay/rust-toolchain@stable
      - uses: https://github.com/Swatinem/rust-cache@v2
        with:
          cache-targets: false
      - run: cargo build --all-features --all-targets --locked
      - run: cargo test --all-features --locked

  msrv:
    runs-on: ubuntu-24.04
    steps:
      - uses: https://data.forgejo.org/actions/checkout@v6
      - uses: https://github.com/dtolnay/rust-toolchain@master
        with:
          toolchain: "1.97"
      - uses: https://github.com/Swatinem/rust-cache@v2
        with:
          cache-targets: false
      - run: cargo check --all-features --all-targets --locked

  # Replaces the old 78-entry hand-written feature matrix.
  features:
    runs-on: ubuntu-24.04
    steps:
      - uses: https://data.forgejo.org/actions/checkout@v6
      - uses: https://github.com/dtolnay/rust-toolchain@stable
      - uses: https://github.com/Swatinem/rust-cache@v2
        with:
          cache-targets: false
      - uses: https://github.com/taiki-e/install-action@v2
        with:
          tool: cargo-hack
      - run: cargo hack check --each-feature --no-dev-deps

  docs:
    runs-on: ubuntu-24.04
    env:
      RUSTDOCFLAGS: -D warnings
    steps:
      - uses: https://data.forgejo.org/actions/checkout@v6
      - uses: https://github.com/dtolnay/rust-toolchain@stable
      - uses: https://github.com/Swatinem/rust-cache@v2
        with:
          cache-targets: false
      - run: cargo doc --all-features --no-deps --locked

  semver:
    if: github.event_name == 'pull_request'
    runs-on: ubuntu-24.04
    steps:
      - uses: https://data.forgejo.org/actions/checkout@v6
      - uses: https://github.com/obi1kenobi/cargo-semver-checks-action@v2
        with:
          feature-group: all-features

  # Smoke fuzz: 6 curated targets, 20s each. Full 18-target sweep stays local.
  # http2 is here because its HPACK decoder is hand-rolled and carries
  # state across every field block on the connection — the shape where a
  # bug surfaces frames later rather than at the malformed input.
  fuzz-smoke:
    runs-on: ubuntu-24.04
    steps:
      - uses: https://data.forgejo.org/actions/checkout@v6
      - uses: https://github.com/dtolnay/rust-toolchain@nightly
      - uses: https://github.com/Swatinem/rust-cache@v2
        with:
          workspaces: |
            . -> target
            fuzz -> fuzz/target
      - run: cargo install cargo-fuzz --locked
      - name: Fuzz smoke
        run: |
          for t in dns_udp http http2 hpack_roundtrip tls layers; do
            cargo +nightly fuzz run "$t" -- -max_total_time=20 -timeout=10 -rss_limit_mb=2048
          done