Skip to content

docs: nport-api is deleted from staging #129

docs: nport-api is deleted from staging

docs: nport-api is deleted from staging #129

Workflow file for this run

name: Codegen drift
# The single mechanism keeping three languages honest: regenerate everything, then fail
# if the tree changed. Without this, `packages/contract`, `schema/`, `crates/contract`,
# the Tauri bindings, and docs/ERRORS.md drift apart silently (ADR-0009, invariant 6).
on:
pull_request:
push:
branches: [main, v3-new-architect]
concurrency:
group: codegen-drift-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
COREPACK_ENABLE_DOWNLOAD_PROMPT: 0
jobs:
drift:
name: Regenerate and diff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: corepack enable
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: pnpm
- run: pnpm install --frozen-lockfile
# `cargo xtask codegen` builds `nport` now (it reads `Args`'s clap definition to generate
# `schema/cli.json`), which pulls in `nport-protocol`, whose `build.rs` shells out to `capnp`.
# Before that dependency this job needed no system toolchain at all — the commit that added it
# claimed "the drift workflow already pays for" a Rust build, and this is that claim being wrong.
- uses: ./.github/actions/install-capnp
- run: rustup show active-toolchain || rustup toolchain install
- uses: Swatinem/rust-cache@v2
- run: pnpm codegen
- run: cargo xtask codegen
- name: Fail if generated files are out of date
run: |
changed=$(git status --porcelain)
if [ -n "$changed" ]; then
echo "::error::Generated files are out of date. Run 'pnpm codegen && cargo xtask codegen' and commit the result."
echo "$changed"
git --no-pager diff
exit 1
fi
echo "Tree is clean."