hydrolysis 0.3.0

GPU-required self-drawn backend for WaterUI
name: CI

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

permissions:
  contents: read

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

env:
  CARGO_INCREMENTAL: "0"
  CARGO_PROFILE_DEV_DEBUG: "0"
  CARGO_PROFILE_TEST_DEBUG: "0"
  CARGO_TERM_COLOR: always

jobs:
  check:
    name: Check / ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy, rustfmt
      - name: Install Linux dependencies
        if: runner.os == 'Linux'
        # The Noto faces are not headers: the renderer shapes a script Roboto
        # does not cover through the platform's own font fallback, and the
        # coverage tests assert that a Han, Arabic, Hebrew, Thai or Devanagari
        # sample shapes to real glyphs rather than to `.notdef`. A runner with
        # no such face installed fails them for want of a font.
        run: |
          sudo apt-get update -o Dir::Etc::SourceList=/etc/apt/sources.list.d/ubuntu.sources -o Dir::Etc::SourceParts=/dev/null
          sudo apt-get install -y libfontconfig1-dev libva-dev libpipewire-0.3-dev libegl-dev libgbm-dev libwayland-dev libxkbcommon-dev libvulkan-dev libasound2-dev fonts-noto-core fonts-noto-cjk
      - name: Install DirectX Shader Compiler
        if: runner.os == 'Windows'
        uses: tracel-ai/github-actions/install-dxc@295f2fdbae5271f4f8ad56d634e4ff6a95daafc8
      - uses: Swatinem/rust-cache@v2
      - if: runner.os == 'Linux'
        run: cargo fmt --all -- --check
      - run: cargo clippy --locked --all-targets --features accessibility,inspector-signals,testing,web,winit -- -D warnings
      - uses: taiki-e/install-action@nextest
      - run: cargo nextest run --locked --features accessibility,inspector-signals,testing,web,winit
      - run: cargo test --locked --doc --features accessibility,inspector-signals,testing,web,winit
      # The macOS WKWebView bridge. `webview-system` is the one feature the
      # sweep above cannot carry — it compiles only where WKWebView exists —
      # so without this step nothing pointed a compiler at it, which is how a
      # `compile_error!` that made the crate impossible to document reached a
      # release run. The suite is `harness = false` (WKWebView is
      # MainThreadOnly and libtest runs tests on worker threads), so `cargo
      # test` runs the binary on the real process main thread.
      - if: runner.os == 'macOS'
        run: cargo test --locked --features webview-system,winit --test real_engine_macos

  wasm:
    name: Check / wasm32
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: wasm32-unknown-unknown
          components: clippy
      - uses: Swatinem/rust-cache@v2
      - run: cargo clippy --locked --target wasm32-unknown-unknown --features web -- -D warnings