zenresize 0.2.0

High-quality image resampling with 31 filters, streaming API, and SIMD acceleration
Documentation
name: CI

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

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always
  CI: true

jobs:
  test:
    name: Test (${{ matrix.name }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - name: Linux x64
            os: ubuntu-latest
          - name: Linux aarch64
            os: ubuntu-24.04-arm
          - name: macOS arm64
            os: macos-latest
          - name: macOS x64
            os: macos-26-intel
          - name: Windows x64
            os: windows-latest
          - name: Windows arm64
            os: windows-11-arm
            # colorutils-rs dev-dep crashes LLVM on aarch64-windows (erydanos codegen bug)
            strip-colorutils: true
    steps:
      - uses: actions/checkout@v6
      - name: Strip local paths
        shell: bash
        run: sed -i.bak 's|, path = "../zenblend"||g' Cargo.toml && rm -f Cargo.lock
      - uses: dtolnay/rust-toolchain@stable
      - name: Strip dev-deps and benches (erydanos LLVM crash on aarch64-windows)
        if: matrix.strip-colorutils
        shell: bash
        run: |
          awk '
            /^\[dev-dependencies\]/ { skip=1; next }
            /^\[\[bench\]\]/ { skip=1; next }
            /bench-simd-competitors/ { next }
            skip && /^\[/ { skip=0 }
            skip == 0 { print }
          ' Cargo.toml > Cargo.toml.ci && mv Cargo.toml.ci Cargo.toml
      - uses: Swatinem/rust-cache@v2
      - name: Run tests (default features)
        run: cargo test ${{ matrix.strip-colorutils && '--lib' || '' }}
      - name: Run tests (no_std)
        if: ${{ !matrix.strip-colorutils }}
        run: cargo test --no-default-features --lib
      - name: Run tests (pretty-safe)
        run: cargo test --features pretty-safe ${{ matrix.strip-colorutils && '--lib' || '' }}

  i686:
    name: Test (Linux i686)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Strip local paths
        shell: bash
        run: sed -i.bak 's|, path = "../zenblend"||g' Cargo.toml && rm -f Cargo.lock
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: i686-unknown-linux-gnu
      - uses: taiki-e/install-action@cross
      - uses: Swatinem/rust-cache@v2
        with:
          key: cross-i686
      - name: Run tests (i686)
        run: cross test --target i686-unknown-linux-gnu

  wasm:
    name: WASM test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Strip local paths
        shell: bash
        run: sed -i.bak 's|, path = "../zenblend"||g' Cargo.toml && rm -f Cargo.lock
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: wasm32-wasip1
      - name: Install wasmtime
        uses: bytecodealliance/actions/wasmtime/setup@v1
      - uses: Swatinem/rust-cache@v2
      - name: Build WASM (std)
        run: cargo check --target wasm32-wasip1 --lib
        env:
          RUSTFLAGS: "-C target-feature=+simd128"

  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Strip local paths
        shell: bash
        run: sed -i.bak 's|, path = "../zenblend"||g' Cargo.toml && rm -f Cargo.lock
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - uses: Swatinem/rust-cache@v2
      - name: Clippy
        run: cargo clippy --all-targets -- -D warnings

  fmt:
    name: Format
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Strip local paths
        shell: bash
        run: sed -i.bak 's|, path = "../zenblend"||g' Cargo.toml && rm -f Cargo.lock
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - name: Check formatting
        run: cargo fmt --all -- --check

  msrv:
    name: MSRV
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Strip local paths
        shell: bash
        run: sed -i.bak 's|, path = "../zenblend"||g' Cargo.toml && rm -f Cargo.lock
      - uses: dtolnay/rust-toolchain@stable
      - uses: taiki-e/install-action@cargo-hack
      - uses: Swatinem/rust-cache@v2
      - name: Check MSRV
        run: cargo hack check --rust-version

  coverage:
    name: Coverage
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Strip local paths
        shell: bash
        run: sed -i.bak 's|, path = "../zenblend"||g' Cargo.toml && rm -f Cargo.lock
      - uses: dtolnay/rust-toolchain@stable
      - uses: taiki-e/install-action@cargo-llvm-cov
      - uses: Swatinem/rust-cache@v2
      - name: Generate coverage
        run: cargo llvm-cov --lcov --output-path lcov.info
      - name: Upload coverage
        uses: codecov/codecov-action@v5
        with:
          files: lcov.info
          fail_ci_if_error: false
        continue-on-error: true
        env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}