studio-worker 0.4.6

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

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

permissions:
  contents: read

jobs:
  coverage:
    name: Test coverage
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6

      # Nightly is the canonical accurate-coverage toolchain: the crate's
      # 26 `#[cfg_attr(coverage_nightly, coverage(off))]` annotations
      # (host-, network-, env-, and platform-dependent code) only take
      # effect under the `coverage_nightly` cfg cargo-llvm-cov sets on
      # nightly. On stable those exclusions compile to nothing, so the
      # gate would measure untestable code and drift with the host GPU.
      - uses: dtolnay/rust-toolchain@nightly
        with:
          components: llvm-tools-preview

      - uses: swatinem/rust-cache@v2

      - name: Install cargo-llvm-cov
        uses: taiki-e/install-action@cargo-llvm-cov

      # Measure the headless core.  The `ui` feature (now on by default)
      # is egui rendering + OS tray glue that isn't unit-testable, so we
      # gate coverage on `--no-default-features` to keep the number
      # meaningful (the UI still gets clippy + tests in checks.yml).
      - name: Run coverage
        run: |
          cargo +nightly llvm-cov --workspace --no-default-features \
            --ignore-filename-regex 'src/main\.rs$|src/engine/sdcpp\.rs$|src/ws/session\.rs$' \
            --fail-under-lines 90 \
            --summary-only

      - name: Upload lcov to Codecov
        if: success()
        run: |
          cargo +nightly llvm-cov --workspace --no-default-features \
            --ignore-filename-regex 'src/main\.rs$|src/engine/sdcpp\.rs$|src/ws/session\.rs$' \
            --lcov --output-path lcov.info
        continue-on-error: true