studio-worker 0.4.7

Pull-based image-generation worker for the minis.gg studio.
Documentation
name: Build

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

permissions:
  contents: read

jobs:
  build:
    name: Build (${{ matrix.name }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - name: Windows x64
            os: windows-latest
            target: x86_64-pc-windows-msvc
          - name: Linux x64
            os: ubuntu-latest
            target: x86_64-unknown-linux-gnu
          - name: Linux ARM
            os: ubuntu-24.04-arm
            target: aarch64-unknown-linux-gnu
          - name: macOS ARM
            os: macos-latest
            target: aarch64-apple-darwin
          - name: macOS Intel
            os: macos-latest
            target: x86_64-apple-darwin
    steps:
      - uses: actions/checkout@v6

      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}

      - uses: swatinem/rust-cache@v2

      - name: Build release
        run: cargo build --release --target ${{ matrix.target }}

  # Validate the fully-loaded release feature set builds natively on
  # macOS + Windows in **release profile** (the same link cargo-dist
  # performs).  llama is gated off Windows (it can't link there — see
  # Cargo.toml), so this is UI + candle image + media on Windows, and
  # UI + llama + candle + media on macOS.  Linux is covered by
  # checks.yml's `all-backends` entry.
  build-all-backends:
    name: All backends (${{ matrix.name }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - name: Windows x64
            os: windows-latest
          - name: macOS ARM
            os: macos-latest
    steps:
      - uses: actions/checkout@v6

      - uses: dtolnay/rust-toolchain@stable

      - uses: swatinem/rust-cache@v2
        with:
          key: all-backends

      # cmake (for the llama.cpp build) is preinstalled on the GitHub
      # Windows + macOS runners; the step is a guard against drift.
      - name: Ensure cmake
        run: cmake --version

      - name: Build with all backends (release)
        run: cargo build --release --features all