libmv-capi-sys 0.1.3

Unsafe FFI bindings for libmv, Blender's motion-tracking library
Documentation
name: CI

on:
  push:
    branches: [master]
  pull_request:

# Only keep the latest run per branch/PR; cancel superseded ones.
concurrency:
  group: ci-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build:
    name: Build (${{ matrix.os }}, ${{ matrix.profile }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest]
        profile: [debug, release]
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive

      - name: Install Linux build dependencies
        if: runner.os == 'Linux'
        shell: bash
        run: sudo apt-get update && sudo apt-get install -y cmake libjpeg-dev libpng-dev

      - name: Set LIBCLANG_PATH (Windows)
        if: runner.os == 'Windows'
        shell: pwsh
        run: |
          if (Test-Path "C:\Program Files\LLVM\bin\libclang.dll") {
            "LIBCLANG_PATH=C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_ENV -Append
          }

      - uses: ./.github/actions/setup-rust
        with:
          cache-key: build-${{ matrix.profile }}

      - name: Build
        shell: bash
        run: cargo build ${{ matrix.profile == 'release' && '--release' || '' }}

  clippy:
    name: Clippy (ubuntu-latest)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive

      - name: Install Linux build dependencies
        shell: bash
        run: sudo apt-get update && sudo apt-get install -y cmake libjpeg-dev libpng-dev

      - uses: ./.github/actions/setup-rust
        with:
          components: clippy
          cache-key: clippy

      - name: Run clippy
        run: cargo clippy --all-targets -- -D warnings

  fmt:
    name: Rustfmt (ubuntu-latest)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: ./.github/actions/setup-rust
        with:
          components: rustfmt
          cache-key: fmt

      - name: Check formatting
        run: cargo fmt --check