mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-25 17:30:56 +08:00
Added govulncheck to CI and local verification
This commit is contained in:
+13
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user