rust-j2k 0.3.0

Pure-Rust JPEG 2000 (ISO/IEC 15444) codec, built GRIB2-decode-first toward OpenJPEG-level coverage.
Documentation
name: CI

# Quality gates from .claude/rules/conventions.md. These run on every PR and on
# pushes to main; enable them as required status checks in branch protection.
on:
  pull_request:
  push:
    branches: [main]

# Cancel superseded runs on the same ref to save CI minutes.
concurrency:
  group: ci-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always
  CARGO_INCREMENTAL: "0"

jobs:
  fmt:
    name: rustfmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - run: cargo fmt --all -- --check

  clippy:
    name: clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - uses: Swatinem/rust-cache@v2
      - run: cargo clippy --all-targets -- -D warnings

  test:
    name: test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo test --all-targets
      - name: Doc tests
        run: cargo test --doc

  msrv:
    name: msrv
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      # Must match rust-version in Cargo.toml. The pin is only a claim until this
      # job proves the crate still builds on it, so bump both together.
      - uses: dtolnay/rust-toolchain@1.87
      - uses: Swatinem/rust-cache@v2
      - run: cargo check

  deny:
    name: cargo-deny
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: EmbarkStudios/cargo-deny-action@v2
        with:
          command: check

  package-hygiene:
    name: package hygiene
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
      # The ISO/IEC 15444-4 conformance corpus is committed for tests but carries
      # a conformance-only license, so it must never ship in the packaged crate
      # (see tests/fixtures/conformance/COPYRIGHT and the `exclude` in Cargo.toml).
      # Guard that invariant against an accidental include/exclude regression.
      - name: Conformance corpus stays out of the package
        run: |
          if cargo package --list --allow-dirty | grep -q 'tests/fixtures/conformance/'; then
            echo "::error::conformance corpus is in the packaged crate; it is license-restricted and must stay excluded"
            exit 1
          fi

  fuzz-smoke:
    name: fuzz smoke
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@nightly
      - uses: Swatinem/rust-cache@v2
        with:
          workspaces: fuzz
      - uses: taiki-e/install-action@v2
        with:
          tool: cargo-fuzz
      # Short robustness smoke over every target: the goal is to catch panics
      # on malformed input, not to find deep bugs, so keep each run bounded.
      # `cargo fuzz build` first so a target that stops compiling fails the job
      # explicitly rather than inside a run step.
      # Pin the gnu host triple: cargo-fuzz otherwise defaults to a musl target
      # whose std isn't installed on the runner.
      - name: Build all fuzz targets
        run: cargo fuzz build --target x86_64-unknown-linux-gnu
      - name: Fuzz decode (60s)
        run: cargo fuzz run decode --target x86_64-unknown-linux-gnu -- -max_total_time=60 -rss_limit_mb=4096
      - name: Fuzz tile_body (45s)
        run: cargo fuzz run tile_body --target x86_64-unknown-linux-gnu -- -max_total_time=45 -rss_limit_mb=4096
      - name: Fuzz tier1_block (30s)
        run: cargo fuzz run tier1_block --target x86_64-unknown-linux-gnu -- -max_total_time=30 -rss_limit_mb=4096
      - name: Fuzz mq (15s)
        run: cargo fuzz run mq --target x86_64-unknown-linux-gnu -- -max_total_time=15 -rss_limit_mb=4096