vips 0.2.0

Rust bindings for libvips: fast, low-memory image processing with a safe, ergonomic API.
Documentation
name: Build

on:
  push:
    branches: [ "main", "feature/**" ]
  pull_request:
    branches: [ "main", "feature/**" ]

env:
  CARGO_TERM_COLOR: always

defaults:
  run:
    working-directory: vips-rs

jobs:
  # Cross-platform checks use the published vips-sys package pinned in Cargo.lock.
  test:
    name: ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    timeout-minutes: 30
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
            vips_features: ""
            link_tests: true
            toolchain: stable
          - os: macos-latest
            vips_features: "v8_18"
            link_tests: true
            toolchain: stable
          # Typecheck/clippy against pregenerated vips-sys bindings.
          # Full link tests need a system libvips (vcpkg is slow on GHA).
          - os: windows-latest
            vips_features: ""
            link_tests: false
            toolchain: stable
          - os: ubuntu-latest
            vips_features: ""
            link_tests: true
            toolchain: nightly

    steps:
      - name: Checkout vips-rs
        uses: actions/checkout@v7
        with:
          path: vips-rs

      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.toolchain }}

      - name: Install libvips (Linux)
        if: runner.os == 'Linux' && matrix.link_tests
        run: |
          sudo apt-get update
          sudo apt-get install -y pkg-config libvips-dev libvips-tools

      - name: Install libvips (macOS)
        if: runner.os == 'macOS' && matrix.link_tests
        run: |
          brew install vips pkg-config
          echo "PKG_CONFIG_PATH=$(brew --prefix vips)/lib/pkgconfig:$(brew --prefix)/lib/pkgconfig" >> "$GITHUB_ENV"

      - name: Cache cargo
        uses: actions/cache@v6
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            vips-rs/target
          key: ${{ runner.os }}-${{ matrix.toolchain }}-cargo-${{ hashFiles('vips-rs/Cargo.lock') }}

      - name: cargo check
        run: cargo check --all-features --locked

      - name: cargo clippy
        if: matrix.toolchain == 'stable'
        run: cargo clippy --locked --all-targets --features="${{ matrix.vips_features }}" -- -D warnings

      - name: cargo test
        if: matrix.link_tests
        run: cargo test --locked --features="${{ matrix.vips_features }}"

      - name: cargo build (release)
        if: matrix.link_tests
        run: cargo build --locked --release --features="${{ matrix.vips_features }}"

  rust_fmt_check:
    name: RustFmt
    runs-on: ubuntu-latest
    timeout-minutes: 10
    # Do not inherit workspace working-directory — checkout is at the repo root.
    defaults:
      run:
        working-directory: .
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - name: Run cargo fmt
        run: cargo fmt --all -- --check