quickgui 0.1.1

A damage-driven, GPU-accelerated desktop GUI foundation
Documentation
name: CI

on:
  push:
  pull_request:
  workflow_dispatch:

permissions:
  contents: read

concurrency:
  group: ci-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1

jobs:
  macos-quality:
    name: macOS quality gate
    runs-on: macos-latest
    timeout-minutes: 45
    steps:
      - uses: actions/checkout@v7
      - uses: mlugg/setup-zig@v2
        with:
          version: 0.15.2
      - name: Verify release metadata
        id: release
        shell: bash
        run: |
          version=$(awk -F '"' '/^version = / { print $2; exit }' Cargo.toml)
          if [[ -z "$version" ]]; then
            echo "Could not read the QuickGUI package version" >&2
            exit 1
          fi
          if [[ "$GITHUB_REF_TYPE" == "tag" && "$GITHUB_REF_NAME" != "v$version" ]]; then
            echo "Tag $GITHUB_REF_NAME does not match package version $version" >&2
            exit 1
          fi
          echo "version=$version" >> "$GITHUB_OUTPUT"
      - name: Install Rust
        run: |
          rustup toolchain install stable --profile minimal --component clippy,rustfmt
          rustup toolchain install 1.90.0 --profile minimal
          rustup default stable
      - name: Cache Cargo
        uses: actions/cache@v6
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: cargo-${{ runner.os }}-stable-${{ hashFiles('Cargo.lock') }}
          restore-keys: cargo-${{ runner.os }}-stable-
      - name: Check formatting
        run: cargo fmt --all -- --check
      - name: Check release-gate scripts
        run: bash -n scripts/*.sh
      - name: Run all tests
        run: scripts/with-macos-ghostty-zig.sh cargo test --all-targets --all-features --locked
      - name: Check every target and feature
        run: scripts/with-macos-ghostty-zig.sh cargo check --all-targets --all-features --locked
      - name: Check minimum supported Rust version
        run: scripts/with-macos-ghostty-zig.sh cargo +1.90.0 check --all-targets --all-features --locked
      - name: Run Clippy
        run: scripts/with-macos-ghostty-zig.sh cargo clippy --all-targets --all-features --locked -- -D warnings
      - name: Build documentation
        env:
          RUSTDOCFLAGS: -D warnings
        run: scripts/with-macos-ghostty-zig.sh cargo doc --no-deps --all-features --locked
      - name: Verify publish archives and downstream installation
        env:
          QUICKGUI_PACKAGE_TARGET_DIR: target/package-gate
          QUICKGUI_PACKAGE_TOOLCHAIN: 1.90.0
        run: scripts/package-release-gate.sh
      - name: Upload verified release-candidate crates
        if: github.event_name != 'pull_request'
        uses: actions/upload-artifact@v7
        with:
          name: quickgui-${{ steps.release.outputs.version }}-crates-${{ github.sha }}
          path: |
            target/package-gate/package/*.crate
            target/package-gate/package/SHA256SUMS
            CHANGELOG.md
            docs/releasing.md
          if-no-files-found: error
          retention-days: 30

  portable-check:
    name: ${{ matrix.name }} compile gate
    runs-on: ${{ matrix.os }}
    timeout-minutes: 30
    strategy:
      fail-fast: false
      matrix:
        include:
          - name: Linux MSRV
            os: ubuntu-latest
            toolchain: 1.90.0
          - name: Windows
            os: windows-latest
            toolchain: stable
    steps:
      - uses: actions/checkout@v7
      - uses: mlugg/setup-zig@v2
        with:
          version: 0.15.2
      - name: Install Rust ${{ matrix.toolchain }}
        run: rustup toolchain install ${{ matrix.toolchain }} --profile minimal && rustup default ${{ matrix.toolchain }}
      - name: Cache Cargo
        uses: actions/cache@v6
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: cargo-${{ runner.os }}-${{ matrix.toolchain }}-${{ hashFiles('Cargo.lock') }}
          restore-keys: cargo-${{ runner.os }}-${{ matrix.toolchain }}-
      - name: Check every target and feature
        run: cargo check --all-targets --all-features --locked