openpencil/.github/workflows/rust-check.yml
Kayshen-X 77dca8c01b chore: retire TypeScript OpenPencil, delete apps/* + pen-* packages
The product is now Rust (crates/) + the Zig agent runtime
(packages/agent-native) + the wasm-backed web SDK (packages/op-web-sdk*).
Delete the retired TypeScript editor/desktop/CLI (apps/*), the pen-*
packages, and their orphaned TS tooling, Dockerfile, and root tsconfig.

Rust-side hooks into the deleted TS are rehomed so the workspace still
builds, tests, and releases green:
- op-mcp: vendor the 10 element-tool-defs shards it include_str!'d from
  pen-mcp into crates/op-mcp/assets/element-tool-defs/ (git renames), and
  repoint the compile-time includes + the runtime parity test's read_dir.
- op-orchestrator: reword the parity panic that named the retired
  dump-planner-golden.ts generator (goldens stay as frozen baselines).
- CI: drop the TS-derive golden-drift + planner-parity oracle jobs and the
  TS path filters from rust-check.yml; repoint the cargo-bundle icon in
  rust-release.yml to crates/op-host-desktop/assets/icon.png.
- Release (Windows): recover the deleted apps/desktop/build/icon.ico into
  crates/op-host-desktop/assets/icon.ico and repoint the NSIS installer
  (rust-release.yml /DICON_FILE + package-windows.nsi ICON_FILE fallback +
  its example invocation), so the Windows release build still finds it.
- Remove the dead .githooks/post-commit hook — it rebuilt the deleted
  out/mcp-server.cjs via the removed mcp:compile script and only watched
  now-deleted pen-* paths; the Rust MCP is built by cargo.
- Recover apps/web/public/logo-discord.svg to screenshot/ and repoint the
  15 READMEs' logo/link paths.

package.json is now Rust-first (dev/build/test -> cargo + serve-web) and
docs (CLAUDE.md/AGENTS.md/packages+crates CLAUDE.md) describe the Rust
product. The retired TS remains recoverable via git (last tag v0.7.5).

Verified: cargo check --workspace green; cargo test -p op-mcp 353 passed;
cargo test -p op-orchestrator 848 passed; cargo test --workspace --no-run
compiles all targets; rust-release.yml parses and references no deleted
build assets.

Pre-commit fmt hook bypassed: its cargo fmt --check is pre-red from a
repo-wide stable-vs-nightly rustfmt config drift affecting unrelated files;
the .rs files touched here produce no fmt diff.
2026-07-01 21:12:39 +08:00

104 lines
3.9 KiB
YAML

name: Rust check (native)
on:
pull_request:
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/**'
- '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.
- run: cargo test --workspace
- name: Run CanvasKit web host tests
run: cargo test -p op-host-web --features canvaskit
- 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