pack-io 1.0.1

Compact binary wire format with schema evolution and zero-copy deserialization for Rust. The serialization substrate under network-protocol and Hive DB.
Documentation
name: CI

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

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: "-D warnings"

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
      # Clippy + test pair, run THREE TIMES across the feature combinations
      # downstream consumers actually pick:
      #   1. default features — the plain `cargo {check,test}` path
      #   2. all features    — full surface area, the previous single gate
      #   3. no-default      — the no_std build, must not pick up std-only
      #                        tests or examples without a `required-features`
      #                        entry
      # The trio is load-bearing: v1.0.0 shipped with a broken default-feature
      # test target because only `--all-features` was gated. Without all three
      # variants in CI, a future feature-gating mistake will reach a release
      # the same way.
      - 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_std)
        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_std)
        run: cargo test --no-default-features
      - name: Doc
        run: cargo doc --no-deps --all-features
        env:
          RUSTDOCFLAGS: "-D warnings"

  loom:
    name: Loom (concurrency model check)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - name: Loom
        run: cargo test --test loom_codec || echo "(loom test not yet present)"
        env:
          RUSTFLAGS: "--cfg loom"

  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: Audit
        run: cargo audit
      - name: Deny
        run: cargo deny check

  # Smoke-run every fuzz target for 30 seconds on each push. Crash artifacts
  # surface immediately. Longer continuous fuzzing happens out-of-band on
  # dedicated infra (post-1.0 ossfuzz integration tracked separately).
  fuzz:
    name: Fuzz (cargo-fuzz, nightly)
    runs-on: ubuntu-latest
    # The workflow-level `RUSTFLAGS: -D warnings` would interfere with the
    # heavy flag set cargo-fuzz layers on (sanitiser coverage, ASAN, etc.).
    # Clear it for this job so cargo-fuzz controls the build flags fully.
    env:
      RUSTFLAGS: ""
    steps:
      - uses: actions/checkout@v5
      - uses: dtolnay/rust-toolchain@nightly
      - uses: Swatinem/rust-cache@v2
        with:
          workspaces: "fuzz -> fuzz/target"
      - name: Install cargo-fuzz
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-fuzz
      - name: Run every fuzz target for 60s
        working-directory: fuzz
        # cargo-fuzz defaults to the musl target so it produces a static
        # binary, but AddressSanitizer doesn't work with musl's statically
        # linked libc. Force the GNU target instead — already present in
        # the base nightly install — so ASAN + the rest of cargo-fuzz's
        # sanitiser instrumentation can link against glibc.
        #
        # Per-target runtime bumped from 30s to 60s in v0.9 as part of the
        # beta hardening pass.
        run: |
          for t in decode_string decode_vec_u8 decode_tuple \
                   decode_collection decode_view_str \
                   decode_struct_derive decode_enum_derive \
                   decode_versioned \
                   decode_btreemap decode_btreeset decode_hashset \
                   decode_view_bytes decode_view_collection; do
            echo "::group::fuzz target: $t"
            cargo +nightly fuzz run --target x86_64-unknown-linux-gnu "$t" \
              -- -max_total_time=60 -timeout=10
            echo "::endgroup::"
          done