fix(release): 完成分发证明代际绑定与质量门禁收口
bat-rust / Build and test Rust (push) Canceled after 0s
bat-rust / Build and test Go API (push) Canceled after 0s

This commit is contained in:
2026-09-15 21:13:52 +08:00
parent 13b0bd5b45
commit 99355effe4
29 changed files with 1137 additions and 189 deletions
+1 -27
View File
@@ -20,34 +20,8 @@ run_required() {
printf 'PASS required: %s\n' "${name}"
}
check_gofmt() {
local -a go_dirs=()
local -a go_files=()
local dir file formatted dirs_file
dirs_file="$(mktemp)"
if ! go list -f '{{.Dir}}' ./... >"${dirs_file}"; then
rm -f "${dirs_file}"
return 1
fi
mapfile -t go_dirs <"${dirs_file}"
rm -f "${dirs_file}"
for dir in "${go_dirs[@]}"; do
for file in "${dir}"/*.go; do
[[ -f "${file}" ]] && go_files+=("${file}")
done
done
if ((${#go_files[@]} == 0)); then
return
fi
formatted="$(gofmt -l "${go_files[@]}")"
if [[ -n "${formatted}" ]]; then
printf 'gofmt required; files need formatting:\n%s\n' "${formatted}" >&2
return 1
fi
}
run_required "Rust formatting" cargo fmt --all -- --check
run_required "Go formatting" check_gofmt
run_required "Go formatting" make check-go-format
run_required "Rust check" cargo check --workspace --locked
run_required "Rust release build" cargo build --workspace --release --locked
run_required "Rust clippy" cargo clippy --workspace --all-targets --locked -- -D warnings