ci(ananke): enforce ordered quality gate flow
This commit is contained in:
parent
912f97b58a
commit
33589e8940
@ -158,15 +158,9 @@ mkdir -p "${BUILD_DIR}"
|
|||||||
rm -f "${COVERAGE_PROFILE}" "${COVERAGE_PERCENT_FILE}"
|
rm -f "${COVERAGE_PROFILE}" "${COVERAGE_PERCENT_FILE}"
|
||||||
printf 'failed\n' > "${BUILD_DIR}/docs-naming.status"
|
printf 'failed\n' > "${BUILD_DIR}/docs-naming.status"
|
||||||
|
|
||||||
echo "[quality] unit tests + workspace coverage profile"
|
echo "[quality] dependency download"
|
||||||
export GOPROXY="${GOPROXY:-https://proxy.golang.org,direct}"
|
export GOPROXY="${GOPROXY:-https://proxy.golang.org,direct}"
|
||||||
run_with_retry 4 go mod download
|
run_with_retry 4 go mod download
|
||||||
run_with_retry 3 go test -coverprofile="${COVERAGE_PROFILE}" ./...
|
|
||||||
coverage_percent="$(go tool cover -func="${COVERAGE_PROFILE}" | awk '/^total:/ {gsub("%","",$3); print $3}')"
|
|
||||||
if [[ -z "${coverage_percent}" ]]; then
|
|
||||||
coverage_percent="0"
|
|
||||||
fi
|
|
||||||
printf '%s\n' "${coverage_percent}" > "${COVERAGE_PERCENT_FILE}"
|
|
||||||
|
|
||||||
echo "[quality] hygiene: doc contracts"
|
echo "[quality] hygiene: doc contracts"
|
||||||
cd testing
|
cd testing
|
||||||
@ -189,6 +183,14 @@ echo "[quality] lint"
|
|||||||
echo "[quality] installer template contracts"
|
echo "[quality] installer template contracts"
|
||||||
./scripts/verify_install_templates.sh
|
./scripts/verify_install_templates.sh
|
||||||
|
|
||||||
|
echo "[quality] unit tests + workspace coverage profile"
|
||||||
|
run_with_retry 3 go test -coverprofile="${COVERAGE_PROFILE}" ./...
|
||||||
|
coverage_percent="$(go tool cover -func="${COVERAGE_PROFILE}" | awk '/^total:/ {gsub("%","",$3); print $3}')"
|
||||||
|
if [[ -z "${coverage_percent}" ]]; then
|
||||||
|
coverage_percent="0"
|
||||||
|
fi
|
||||||
|
printf '%s\n' "${coverage_percent}" > "${COVERAGE_PERCENT_FILE}"
|
||||||
|
|
||||||
echo "[quality] per-file coverage gate (95%)"
|
echo "[quality] per-file coverage gate (95%)"
|
||||||
cd testing
|
cd testing
|
||||||
ANANKE_ENFORCE_COVERAGE=1 ANANKE_PER_FILE_COVERAGE_TARGET=95 go test ./coverage -run TestPerFileCoverageReport -count=1 -v
|
ANANKE_ENFORCE_COVERAGE=1 ANANKE_PER_FILE_COVERAGE_TARGET=95 go test ./coverage -run TestPerFileCoverageReport -count=1 -v
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user