mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 12:45:17 +08:00
fix(release):完善当前分发证明与质量门禁
This commit is contained in:
+16
-19
@@ -9,6 +9,9 @@ export GOCACHE
|
||||
: "${XDG_CACHE_HOME:=/tmp/bat-xdg-cache}"
|
||||
export XDG_CACHE_HOME
|
||||
|
||||
source "${repo_root}/scripts/ci-versions.sh"
|
||||
export GOLANGCI_LINT_VERSION
|
||||
|
||||
run_required() {
|
||||
local name="$1"
|
||||
shift
|
||||
@@ -52,24 +55,18 @@ run_required "Rust tests" cargo test --workspace --locked
|
||||
run_required "Go API tests" go test ./internal/api/... ./internal/backendrpc/... ./cmd/bat-api/...
|
||||
run_required "Go API vet" go vet ./internal/api/... ./internal/backendrpc/... ./cmd/bat-api/...
|
||||
run_required "Go API build" go build -o /tmp/bat-api ./cmd/bat-api
|
||||
run_required "Go lint version" bash -c '
|
||||
source scripts/ci-versions.sh
|
||||
command -v golangci-lint >/dev/null 2>&1 ||
|
||||
{ printf "golangci-lint %s is required but not installed\n" "${GOLANGCI_LINT_VERSION}" >&2; exit 1; }
|
||||
actual="$(golangci_lint_actual_version)"
|
||||
if [[ "${actual}" != "${GOLANGCI_LINT_VERSION}" ]]; then
|
||||
printf "golangci-lint version mismatch: required=%s actual=%s\n" \
|
||||
"${GOLANGCI_LINT_VERSION}" "${actual:-unknown}" >&2
|
||||
exit 1
|
||||
fi
|
||||
'
|
||||
run_required "Go lint" golangci-lint run ./...
|
||||
run_required "Documentation, OpenAPI, and contract checks" make check-docs
|
||||
|
||||
optional_failed=0
|
||||
if command -v golangci-lint >/dev/null 2>&1; then
|
||||
printf 'RUN optional: Go lint (golangci-lint)\n'
|
||||
if golangci-lint run ./...; then
|
||||
printf 'PASS optional: Go lint (golangci-lint)\n'
|
||||
else
|
||||
printf 'FAIL optional: Go lint (golangci-lint); reason=lint findings\n' >&2
|
||||
optional_failed=1
|
||||
fi
|
||||
else
|
||||
printf 'SKIP optional: Go lint (golangci-lint); reason=command not installed\n'
|
||||
fi
|
||||
|
||||
if ((optional_failed)); then
|
||||
printf 'required check-only gates passed; optional gates failed\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf 'required check-only gates passed; optional gates are reported above\n'
|
||||
printf 'all required check-only gates passed\n'
|
||||
|
||||
Reference in New Issue
Block a user