fix(ci): types drift gate fails closed on a git error and sees untracked files whatever the git config
The ci.yml step assigns git status to a variable before testing it (a git failure now fails the step, as scripts/check-all.sh already did); both gates pass --untracked-files=all; the rust-check.sh comment names the real gate.
This commit is contained in:
1 parent
073b25e52b
commit
496f54990a
4 files changed
+10
-7
No files matched your search
@@ -29,7 +29,9 @@ jobs:
|
|||||||
- name: fmt, clippy, tests, ts-rs export, cargo-deny (licenses, bans, sources)
|
- name: fmt, clippy, tests, ts-rs export, cargo-deny (licenses, bans, sources)
|
||||||
run: bash docker/rust-run.sh bash scripts/rust-check.sh
|
run: bash docker/rust-run.sh bash scripts/rust-check.sh
|
||||||
- name: Committed TypeScript types match the Rust contracts (no modified or new file)
|
- 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)
|
- 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
|
run: bash docker/rust-run.sh bash scripts/wasm-build.sh
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
Stages, in order: `scripts/rust-check.sh` (native), the ts-rs types drift
|
||||||
(`git status --porcelain -- packages/core-wasm/types` must be empty: a
|
(`git status --porcelain --untracked-files=all -- packages/core-wasm/types`
|
||||||
modified or a new type file both fail), `cargo deny check advisories`
|
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
|
(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`
|
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
|
(native), `pnpm check` (typecheck, tests including the `core-wasm` proofs on
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ stage() {
|
|||||||
stage "rust: fmt, clippy, tests, ts-rs export, cargo-deny (native toolchain)"
|
stage "rust: fmt, clippy, tests, ts-rs export, cargo-deny (native toolchain)"
|
||||||
bash scripts/rust-check.sh
|
bash scripts/rust-check.sh
|
||||||
stage "rust: committed TypeScript types match the Rust contracts (no modified or new file)"
|
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
|
if [ -n "$drift" ]; then
|
||||||
echo "packages/core-wasm/types differs from the committed types:" >&2
|
echo "packages/core-wasm/types differs from the committed types:" >&2
|
||||||
echo "$drift" >&2
|
echo "$drift" >&2
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ cargo fmt --all --check
|
|||||||
cargo clippy --workspace --all-targets --locked -- -D warnings
|
cargo clippy --workspace --all-targets --locked -- -D warnings
|
||||||
cargo test --workspace --locked
|
cargo test --workspace --locked
|
||||||
# Exports the TypeScript types of the contracts (ts-rs) into packages/core-wasm/types.
|
# 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
|
# `git status --porcelain --untracked-files=all -- packages/core-wasm/types` must stay
|
||||||
# (scripts/check-all.sh, .gitea/workflows/ci.yml): the committed types never drift from
|
# empty afterwards (scripts/check-all.sh, .gitea/workflows/ci.yml): the committed types
|
||||||
# the Rust structs.
|
# never drift from the Rust structs, and a new type file counts as drift.
|
||||||
cargo test -p faunosteo-core --features ts --locked
|
cargo test -p faunosteo-core --features ts --locked
|
||||||
cargo deny check licenses bans sources
|
cargo deny check licenses bans sources
|
||||||
Reference in new issue
Block a user