nigig-org/.forgejo/workflows/doc-engine.yml
arena-agent 228bc2c81f
Some checks failed
email.yml / ci(doc-engine): gate the engine coverage, and note it in the doc README (push) Failing after 0s
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
doc-engine / engine (push) Has been cancelled
doc-engine / coverage (push) Has been cancelled
doc-engine / consumer (push) Has been cancelled
ci(doc-engine): gate the engine coverage, and note it in the doc README
New coverage job runs tools/test-doc-engine-coverage.sh on changes to
crates/apps/doc/**, the script itself, or the workflow. A coverage
number nobody gates goes down; the floors (total plus per-file) are the
enforcement. The doc workspace README records the milestone and the two
CRDT-tolerance behaviors the new tests pin.
2026-08-17 04:33:08 +00:00

100 lines
3.7 KiB
YAML

name: doc-engine
# CI for the standalone CRDT document engine crate.
#
# Enforces:
# 1. `doc-engine` compiles and its test suite is green (--locked, so the
# committed lockfile is the only dependency resolution).
# 2. Clippy stays at zero warnings: the warning class fixed when this
# workflow was added (`possible_missing_else`) is invisible in review
# and each instance is a potential logic slip.
# 3. nigig-build still compiles and tests green against the new engine:
# the UI consumes the engine through a path dependency, and an engine
# change that breaks the consumer must fail here, not downstream.
#
# `cargo fmt --check` is deliberately not a gate yet: the crate predates
# the rustfmt style of the pinned toolchain and reformatting it wholesale
# would conflict with open lines of work. Same reasoning as the clippy
# note in nigig-build.yml -- a step that cannot fail is worse than no
# step, but a step that always fails gets ignored.
on:
push:
paths:
- 'crates/apps/doc/**'
- 'tools/test-doc-engine-coverage.sh'
- 'Cargo.lock'
- 'Cargo.toml'
- 'rust-toolchain.toml'
- '.forgejo/workflows/doc-engine.yml'
pull_request:
paths:
- 'crates/apps/doc/**'
- 'tools/test-doc-engine-coverage.sh'
- 'Cargo.lock'
- 'Cargo.toml'
- 'rust-toolchain.toml'
- '.forgejo/workflows/doc-engine.yml'
jobs:
engine:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
# The engine is UI-free (serde + serde_json only): no system GUI
# packages, no Makepad checkout resolution beyond the lockfile.
- name: Engine tests
run: cargo test --locked -p doc-engine
- name: Engine clippy
run: cargo clippy --locked -p doc-engine -- -D warnings
- name: Reject whitespace errors
run: git diff --check
# Source coverage for the engine, gated, not just printed.
#
# The crate is UI-free (serde + serde_json only), so unlike the CAD
# harness this needs no host-only shim: tools/test-doc-engine-coverage.sh
# copies the crate into a scratch directory, runs the unit tests plus
# tests/materialize.rs under -C instrument-coverage, and enforces a
# total floor and a per-file floor (a lone total would wave through the
# loss of every test in one module). It installs its own toolchain into
# a mktemp directory and deletes everything through a shell trap, so
# nothing is cached between runs and nothing is left in the workspace.
# Exclusions, the baseline table and what the number does NOT mean live
# in crates/apps/doc/doc-engine/COVERAGE.md.
coverage:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Engine coverage, with floors
run: ./tools/test-doc-engine-coverage.sh
consumer:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
# nigig-build links doc-engine by path; the doc workspace module only
# compiles against the engine API it was written for.
- name: Install native dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq \
pkg-config libwayland-dev libxcursor-dev libxrandr-dev \
libxi-dev libx11-dev libgl1-mesa-dev libasound2-dev \
libpolkit-gobject-1-dev libpolkit-agent-1-dev \
libglib2.0-dev libssl-dev libsqlite3-dev libudev-dev \
libpulse-dev libxkbcommon-dev
- name: Check nigig-build against the engine
run: cargo check --locked -p nigig-build --lib
- name: Test nigig-build against the engine
run: cargo test --locked -p nigig-build --lib