ci: unify rust quality gate and add incremental docs/link checks

This commit is contained in:
Chummy 2026-02-17 14:37:17 +08:00
parent 8a6273b988
commit 6528613c8d
12 changed files with 514 additions and 47 deletions

View file

@ -6,29 +6,38 @@
set -euo pipefail
echo "==> pre-push: checking formatting..."
cargo fmt --all -- --check || {
echo "FAIL: cargo fmt --all -- --check found unformatted code."
echo "Run 'cargo fmt' and try again."
exit 1
}
echo "==> pre-push: running clippy..."
cargo clippy --all-targets -- -D clippy::correctness || {
echo "FAIL: clippy correctness gate reported issues."
echo "==> pre-push: running rust quality gate..."
./scripts/ci/rust_quality_gate.sh || {
echo "FAIL: rust quality gate failed."
exit 1
}
if [ "${ZEROCLAW_STRICT_LINT:-0}" = "1" ]; then
echo "==> pre-push: running strict clippy warnings gate (ZEROCLAW_STRICT_LINT=1)..."
cargo clippy --all-targets -- -D warnings || {
./scripts/ci/rust_quality_gate.sh --strict || {
echo "FAIL: strict clippy warnings gate reported issues."
exit 1
}
fi
if [ "${ZEROCLAW_DOCS_LINT:-0}" = "1" ]; then
echo "==> pre-push: running docs quality gate (ZEROCLAW_DOCS_LINT=1)..."
./scripts/ci/docs_quality_gate.sh || {
echo "FAIL: docs quality gate reported issues."
exit 1
}
fi
if [ "${ZEROCLAW_DOCS_LINKS:-0}" = "1" ]; then
echo "==> pre-push: running docs links gate (ZEROCLAW_DOCS_LINKS=1)..."
./scripts/ci/docs_links_gate.sh || {
echo "FAIL: docs links gate reported issues."
exit 1
}
fi
echo "==> pre-push: running tests..."
cargo test || {
cargo test --locked || {
echo "FAIL: some tests did not pass."
exit 1
}