diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index c71a664b..b349aeb5 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -29,7 +29,9 @@ jobs: - name: fmt, clippy, tests, ts-rs export, cargo-deny (licenses, bans, sources) run: bash docker/rust-run.sh bash scripts/rust-check.sh - name: Committed TypeScript types match the Rust contracts (no modified or new file) - run: test -z "$(git status --porcelain -- packages/core-wasm/types)" || { git status --porcelain -- packages/core-wasm/types; exit 1; } + run: | + drift="$(git status --porcelain --untracked-files=all -- packages/core-wasm/types)" + if [ -n "$drift" ]; then echo "$drift"; exit 1; fi - name: Browser module builds (size printed; the budget is asserted by the vitest proofs) run: bash docker/rust-run.sh bash scripts/wasm-build.sh diff --git a/docs/development/RUST.md b/docs/development/RUST.md index 038c3625..1cb9137f 100644 --- a/docs/development/RUST.md +++ b/docs/development/RUST.md @@ -211,8 +211,9 @@ pnpm check:all # scripts/check-all.sh, stops at the first failure ``` Stages, in order: `scripts/rust-check.sh` (native), the ts-rs types drift -(`git status --porcelain -- packages/core-wasm/types` must be empty: a -modified or a new type file both fail), `cargo deny check advisories` +(`git status --porcelain --untracked-files=all -- packages/core-wasm/types` +must be empty: a modified or a new type file both fail, whatever the git +configuration), `cargo deny check advisories` (warn-only: out of the blocking path by design, review VIII.3, but printed here because no nightly job runs yet; needs the network), `scripts/wasm-build.sh` (native), `pnpm check` (typecheck, tests including the `core-wasm` proofs on diff --git a/scripts/check-all.sh b/scripts/check-all.sh index ac8901cc..02f70846 100755 --- a/scripts/check-all.sh +++ b/scripts/check-all.sh @@ -16,7 +16,7 @@ stage() { stage "rust: fmt, clippy, tests, ts-rs export, cargo-deny (native toolchain)" bash scripts/rust-check.sh stage "rust: committed TypeScript types match the Rust contracts (no modified or new file)" -drift="$(git status --porcelain -- packages/core-wasm/types)" +drift="$(git status --porcelain --untracked-files=all -- packages/core-wasm/types)" if [ -n "$drift" ]; then echo "packages/core-wasm/types differs from the committed types:" >&2 echo "$drift" >&2 diff --git a/scripts/rust-check.sh b/scripts/rust-check.sh index 93b18e43..62b526b9 100755 --- a/scripts/rust-check.sh +++ b/scripts/rust-check.sh @@ -16,8 +16,8 @@ cargo fmt --all --check cargo clippy --workspace --all-targets --locked -- -D warnings cargo test --workspace --locked # Exports the TypeScript types of the contracts (ts-rs) into packages/core-wasm/types. -# `git diff --exit-code -- packages/core-wasm/types` must stay empty afterwards -# (scripts/check-all.sh, .gitea/workflows/ci.yml): the committed types never drift from -# the Rust structs. +# `git status --porcelain --untracked-files=all -- packages/core-wasm/types` must stay +# empty afterwards (scripts/check-all.sh, .gitea/workflows/ci.yml): the committed types +# never drift from the Rust structs, and a new type file counts as drift. cargo test -p faunosteo-core --features ts --locked cargo deny check licenses bans sources