openpencil/.github/workflows/rust-check.yml
Kayshen-X 8cd03adacd fix(ci): repair three v0.8.0-new failures (canvaskit test, windows-aarch64 deps, windows nextest)
Three independent CI failures, none caused by the font-lock push:

1. CanvasKit web-host test variables_panel_open_does_not_paint_legacy_modal
   false-tripped: its '> half viewport' heuristic was a proxy for 'no
   full-viewport modal', but only passed because the property panel used
   to narrow the canvas and clamp the floating VariablesPanel below
   half-width. The nothing-selected-by-default change collapsed the
   property panel, widening the canvas so the legitimate 820x480 panel
   paints unclamped. There is no legacy modal. Retarget the assertion at
   a near full-viewport round fill and positively assert the panel paints.

2. windows-aarch64 cross-check failed: op-host-services + op-orchestrator
   pulled op-mcp's native-only 'script' feature unconditionally, dragging
   in rquickjs-sys which ships no bindings for aarch64-pc-windows-msvc.
   Enable 'script' per-target (off on that unshipped check-only arch).

3. Windows workspace tests segfaulted single-threaded (before the first
   test prints, under --test-threads=1) — an intra-test race a thread
   flag can't serialize. Switch the Windows runner to cargo-nextest (one
   process per test) so the crash is isolated + named; doctests run
   separately.
2026-07-06 22:04:56 +08:00

130 lines
5.2 KiB
YAML

name: Rust check (native)
on:
pull_request:
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/**'
# Parity with the push leg: a PR touching a vendored dep (the
# casement winit fork, jian, agent) must not ride green with
# zero CI.
- 'vendor/**'
- 'rust-toolchain.toml'
- 'rustfmt.toml'
- 'deny.toml'
- 'tools/check-jian-boundaries.sh'
- 'tools/check-web-server-headless.sh'
- 'tools/check-widget-boundary.sh'
- '.github/workflows/rust-check.yml'
push:
branches: ['**']
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/**'
- 'vendor/**'
- 'deny.toml'
- 'rust-toolchain.toml'
- 'rustfmt.toml'
- 'tools/check-jian-boundaries.sh'
- 'tools/check-web-server-headless.sh'
- 'tools/check-widget-boundary.sh'
- '.github/workflows/rust-check.yml'
jobs:
check:
name: ${{ matrix.os }} / 1.94
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
# Keep LF line endings on the Windows runner so `cargo fmt --check`
# does not trip over CRLF-converted vendored sources.
- name: Disable autocrlf
run: git config --global core.autocrlf false
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: '1.94'
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
# Linux GL prerequisites for winit's x11+wayland feature link.
# libxkbcommon-x11-dev / libwayland-dev are winit's link-time deps on
# Linux; the wayland-csd-adwaita feature pulls in xkbcommon + wayland-client.
- name: Install Linux GL prereqs
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libxkbcommon-dev libxkbcommon-x11-dev \
libwayland-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev \
libegl1-mesa-dev libgles2-mesa-dev libgbm-dev mesa-utils \
libfreetype-dev libfontconfig1-dev fonts-noto-cjk
- run: cargo fmt --all -- --check
- run: cargo build --workspace
# GitHub-hosted runners are headless with no reliable Mesa software
# EGL, so STEP1A_REQUIRE_GPU is left unset: the op-host-native GPU
# smoke (memory_loop) self-uses the raster fallback instead of
# hard-failing on EGL init. Real-GPU coverage runs on dev machines.
- name: Test workspace (non-Windows, parallel)
if: runner.os != 'Windows'
run: cargo test --workspace
# Windows: skia's `FontMgr` is DirectWrite, which segfaults
# (STATUS_ACCESS_VIOLATION) when a test spawns a worker thread doing
# font layout (SkiaMeasure) concurrently with the main thread — an
# intra-test race `--test-threads=1` can NOT serialize (it only
# serializes tests against each other, not threads inside one test).
# nextest runs every test in its OWN process, so such a crash is
# isolated + named instead of taking down the whole test binary, and
# cross-test DirectWrite state can't leak between them. Doctests run
# separately (nextest doesn't execute them).
- name: Install cargo-nextest (Windows)
if: runner.os == 'Windows'
uses: taiki-e/install-action@v2
with:
tool: nextest
- name: Test workspace (Windows, nextest per-process isolation)
if: runner.os == 'Windows'
run: cargo nextest run --workspace
- name: Doctests (Windows)
if: runner.os == 'Windows'
run: cargo test --workspace --doc
- name: Run CanvasKit web host tests
run: cargo test -p op-host-web --features canvaskit -- --test-threads=1
- run: cargo clippy --workspace --all-targets -- -D warnings
# Step 1a Phase C Task 4: spec v19 §11 + §12.3 boundary invariants.
# Linux runner has the full mobile target stdlib (`rustup target add`
# in subsequent steps would handle ios/android cargo metadata too,
# but the script uses `cargo tree --target` which only needs the
# cfg-gate evaluation, not the actual target sysroot).
- name: Verify Jian boundary invariants
if: runner.os == 'Linux'
run: |
rustup target add aarch64-linux-android aarch64-apple-ios wasm32-unknown-unknown
bash tools/check-jian-boundaries.sh
- name: Verify Step 1b widget boundary (spec §1.4)
if: runner.os == 'Linux'
run: bash tools/check-widget-boundary.sh
- name: Verify op-host-web-server headless boundary (no winit/glutin/GL)
if: runner.os == 'Linux'
run: bash tools/check-web-server-headless.sh
deny:
name: cargo-deny (native)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- uses: EmbarkStudios/cargo-deny-action@v2 # auto-updates within v2.x; runner cargo at this stage carries cargo-deny 0.18+ which handles modern transitive manifests (Phase 1 Task 1.8 finding)
with:
command: check