openpencil/.github/workflows/rust-check.yml
Kayshen-X d6e5e2b1fd feat(shell-native): Step 1a Task 4 — basic_window demo + acceptance + Phase C Gate
Phase C Task 4 closes Step 1a (G1 shared Skia context) on v0.8.0:

- crates/openpencil-shell-native/examples/basic_window.rs:
  winit + SharedSkiaContext::new_desktop + NativeBackend (Jian DrawOp)
  + JianPointerMapper integration. Paints chrome rect + "Hello 你好"
  + box outline; close → idempotent teardown. Demonstrates Phase B
  Task 3 winit → Jian PointerTranslator → JianPointerMapper →
  ShellEvent pipeline end-to-end.
- crates/openpencil-shell-native/notes/step-1a-{macos,linux,windows}-manual-smoke.md:
  manual GPU smoke runbooks for spec §1.2 acceptance #1 (macOS PASS
  recorded; Linux/Windows pending real-hardware run, deferred per
  CONCERN-R5-1 + WINDOWS_GPU_DEFERRED_NO_RUNNER).
- tools/check-jian-boundaries.sh: spec §11 + §12.3 invariants.
  Verifies that openpencil-app has no direct jian-* dep, mobile
  (aarch64-linux-android, aarch64-apple-ios) and wasm32 closures
  exclude jian-host-desktop / jian-skia, and openpencil-shell-web
  declares no jian-host-desktop dep at the manifest level.
- .github/workflows/rust-check.yml: wires bash tools/check-jian-boundaries.sh
  on Linux runner with mobile + wasm32 targets installed.
- README.md: roadmap entry for the Step 1a milestone.

Verified locally on macOS aarch64:
- cargo fmt --all -- --check
- cargo clippy --workspace --all-targets -- -D warnings
- cargo build --examples --workspace
- cargo test --workspace (38 PASS, 0 FAIL, 0 IGNORED)
- cargo check -p openpencil-shell-native --target {aarch64-linux-android, aarch64-apple-ios}
- bash tools/check-jian-boundaries.sh (4 invariants PASS)
- spec §11 invariants 1–4 grep checks PASS

Spec v19.3 FROZEN (openpencil-docs 651090d); Plan v7 FROZEN.
vendor/jian pinned at c4a794dc.
2026-05-05 12:23:27 +08:00

85 lines
3.1 KiB
YAML

name: Rust check (native)
on:
pull_request:
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/**'
- 'rust-toolchain.toml'
- 'rustfmt.toml'
- 'deny.toml'
- '.github/workflows/rust-check.yml'
push:
branches: [main, 'feat/rust-ification']
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/**'
- 'rust-toolchain.toml'
jobs:
check:
name: ${{ matrix.os }} / 1.85
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: '1.85'
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
- run: cargo fmt --all -- --check
- run: cargo build --workspace
# Step 1a §9.2: Linux GPU smoke must hard-fail on EGL/GL setup failure
# in CI (real Mesa software-rendered EGL pbuffer is available). Local
# dev runners (no GPU + no env var) skip with INCONCLUSIVE marker.
- name: Run tests (Linux with strict GPU gate)
if: runner.os == 'Linux'
env:
STEP1A_REQUIRE_GPU: '1'
run: cargo test --workspace
- name: Run tests (macOS / Windows)
if: runner.os != 'Linux'
run: cargo test --workspace
- 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
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