Added govulncheck to CI and local verification

This commit is contained in:
Gaurav Patidar
2026-11-23 20:24:16 +05:30
parent d235be850e
commit 52a2a6ac87
4 changed files with 29 additions and 3 deletions
+13 -1
View File
@@ -2,9 +2,10 @@
# Verify ARTEX locally, reproducing the checks from .github/workflows/ci.yml.
#
# Usage:
# scripts/verify.sh [--full] [--go-only] [--web-only] [--keep-going]
# scripts/verify.sh [--full] [--security] [--go-only] [--web-only] [--keep-going]
#
# --full also run `go test -race` (the CI package list) and the web static build
# --security run `govulncheck ./...` (requires govulncheck in PATH)
# --go-only run only the Go checks
# --web-only run only the web checks
# --keep-going continue after a failed step and report every failure at the end
@@ -18,12 +19,14 @@ cd "$(dirname "$0")/.."
usage() { sed -n '2,14p' "$0" | sed 's/^# \?//'; }
FULL=0
SECURITY=0
GO_ONLY=0
WEB_ONLY=0
KEEP_GOING=0
while [ $# -gt 0 ]; do
case "$1" in
--full) FULL=1; shift ;;
--security) SECURITY=1; shift ;;
--go-only) GO_ONLY=1; shift ;;
--web-only) WEB_ONLY=1; shift ;;
--keep-going) KEEP_GOING=1; shift ;;
@@ -35,6 +38,10 @@ if [ "$GO_ONLY" -eq 1 ] && [ "$WEB_ONLY" -eq 1 ]; then
echo "--go-only and --web-only are mutually exclusive" >&2
exit 2
fi
if [ "$SECURITY" -eq 1 ] && [ "$WEB_ONLY" -eq 1 ]; then
echo "--security requires the Go checks and cannot be combined with --web-only" >&2
exit 2
fi
FAILED=0
run_step() {
@@ -109,6 +116,11 @@ if want_go; then
run_step "go vet" go vet ./...
run_step "go test -p 1" go test -p 1 ./...
if [ "$SECURITY" -eq 1 ]; then
require_cmd govulncheck
run_step "govulncheck" govulncheck ./...
fi
if [ "$FULL" -eq 1 ]; then
RACE_PKGS=(
./agent ./cmd/artex ./config ./db ./evidence ./guard