xpress-huffman 0.1.0

Pure-Rust, panic-free decompressor for Microsoft Xpress-Huffman ([MS-XCA] §2.2.4, LZXPRESS_HUFFMAN) — the codec behind Win10+ prefetch (MAM), hiberfil.sys, SMB3 and registry-hive compression. Cross-platform, no Windows API.
Documentation
name: CI

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

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always
  CARGO_INCREMENTAL: "0"
  RUSTFLAGS: -Dwarnings

jobs:
  test:
    name: Test & lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
      - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
        with:
          components: rustfmt, clippy
      - run: cargo fmt --check
      - run: cargo clippy --all-targets --all-features
      - run: cargo clippy --all-targets        # default (no_std) feature set
      - run: cargo test --all-features
      - name: no_std build
        run: cargo build

  deny:
    name: cargo-deny (bans/licenses/sources)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
      - uses: EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.4
        with:
          command: check bans licenses sources

  advisories:
    name: cargo-deny (advisories)
    runs-on: ubuntu-latest
    # Informational: a malformed entry in the upstream RustSec advisory-db breaks
    # DB *loading* for the whole ecosystem and must not gate our build. Real
    # advisories against our (zero-dependency) tree still surface here.
    continue-on-error: true
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
      - uses: EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.4
        with:
          command: check advisories

  coverage:
    name: Coverage (100% lib)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
      - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
        with:
          components: llvm-tools-preview
      - uses: taiki-e/install-action@cargo-llvm-cov
      - name: Gate on 100% line coverage (excluding // cov:unreachable)
        run: |
          cargo llvm-cov --all-features --lib --lcov --output-path lcov.info
          # Fail on any DA:<line>,0 whose source line lacks a `// cov:unreachable`
          # marker (the fleet defence-in-depth exemption).
          fail=0
          while IFS= read -r entry; do
            line="${entry#DA:}"; line="${line%,0}"
            src=$(sed -n "${line}p" src/lib.rs)
            case "$src" in
              *cov:unreachable*) ;;
              *) echo "Uncovered (no cov:unreachable): src/lib.rs:${line}: ${src}"; fail=1 ;;
            esac
          done < <(grep -E '^DA:[0-9]+,0$' lcov.info || true)
          exit $fail