This commit is contained in:
1 parent
69383eae7f
commit
6d1c68994c
38 files changed
+744
-443
No files matched your search
+24
-8
@@ -3,6 +3,7 @@
|
||||
# Run lucisv's release gates, each as a separate tools/guard.sh step.
|
||||
#
|
||||
# Steps, in order (names for --only/--skip):
|
||||
# stamp python3 tools/stamp_author.py --check
|
||||
# fmt cargo fmt --all -- --check
|
||||
# clippy cargo clippy --workspace --all-targets -- -D warnings
|
||||
# build cargo test --workspace --all-targets --no-run
|
||||
@@ -15,7 +16,8 @@
|
||||
# node node --test editors/vscode/*_test.js
|
||||
# cross cargo check of the three shipped binaries for Windows and
|
||||
# Linux with the rustup toolchain release.sh --cross uses
|
||||
# (skipped, with a note, when that toolchain is absent).
|
||||
# (fails when that toolchain is absent unless
|
||||
# --allow-skip-cross is passed).
|
||||
# Platform-conditional code is compiled nowhere else before
|
||||
# the release build: 0.65.6 passed every other gate and then
|
||||
# failed to compile for Windows.
|
||||
@@ -33,13 +35,14 @@
|
||||
# and a retry costs one crate, not the whole suite.
|
||||
#
|
||||
# Usage: tools/gates.sh [-o log-dir] [-c corpus-dir] [--only a,b] [--skip a,b]
|
||||
# [--list] [--help]
|
||||
# [--allow-skip-cross] [--list] [--help]
|
||||
# tools/gates.sh # everything
|
||||
# tools/gates.sh --only suites,docs # the per-crate suites and doc-tests
|
||||
# tools/gates.sh --skip corpus # all but the corpus gate
|
||||
#
|
||||
# Exit status: 0 if every selected step passed (or was skipped for a missing
|
||||
# corpus), 1 if any failed or stayed killed, 2 on a usage error.
|
||||
# corpus, or cross with --allow-skip-cross), 1 if any failed or stayed killed,
|
||||
# 2 on a usage error.
|
||||
# Standard tooling only (bash, awk, date, sed).
|
||||
|
||||
set -u
|
||||
@@ -53,6 +56,7 @@ corpus=$HOME/.cache/lucisv-corpus
|
||||
cross_toolchain=$HOME/.rustup/toolchains/stable-aarch64-apple-darwin
|
||||
only=
|
||||
skip=
|
||||
allow_skip_cross=0
|
||||
|
||||
usage() {
|
||||
sed -n '/^# Usage:/,/^# Exit status/p' "$0" | sed '$d; s/^# \{0,1\}//'
|
||||
@@ -70,6 +74,7 @@ while [ $# -gt 0 ]; do
|
||||
--skip) skip=$2 ;;
|
||||
esac
|
||||
shift 2 ;;
|
||||
--allow-skip-cross) allow_skip_cross=1; shift ;;
|
||||
--list) list=1; shift ;;
|
||||
-h|--help) usage; exit 0 ;;
|
||||
*) usage >&2; exit 2 ;;
|
||||
@@ -92,7 +97,7 @@ crates() {
|
||||
|
||||
all_steps() {
|
||||
local c
|
||||
echo fmt clippy build
|
||||
echo stamp fmt clippy build
|
||||
for c in $(crates); do echo "suite:$c"; done
|
||||
echo docs corpus node cross
|
||||
}
|
||||
@@ -122,7 +127,7 @@ selected() {
|
||||
# two minutes; memory is the peak plus headroom. README has the runs.
|
||||
limits() {
|
||||
case $1 in
|
||||
fmt | node) echo "120 2" ;;
|
||||
stamp | fmt | node) echo "120 2" ;;
|
||||
clippy) echo "900 6" ;;
|
||||
build) echo "900 8" ;;
|
||||
suite:lucisv_server | suite:lucisv_mcp) echo "600 4" ;;
|
||||
@@ -136,6 +141,7 @@ limits() {
|
||||
# The command for step $1, into the array `cmd`.
|
||||
set_command() {
|
||||
case $1 in
|
||||
stamp) cmd=(python3 tools/stamp_author.py --check) ;;
|
||||
fmt) cmd=(cargo fmt --all -- --check) ;;
|
||||
clippy) cmd=(cargo clippy --workspace --all-targets -- -D warnings) ;;
|
||||
build) cmd=(cargo test --workspace --all-targets --no-run) ;;
|
||||
@@ -219,10 +225,20 @@ for step in $steps; do
|
||||
continue
|
||||
fi
|
||||
if [ "$step" = cross ] && [ ! -x "$cross_toolchain/bin/cargo" ]; then
|
||||
echo "skipped: no rustup toolchain at $cross_toolchain (tools/RELEASING.md)" >"$log"
|
||||
echo " skip $step (no rustup toolchain)"
|
||||
rows="$rows$step|SKIPPED (no toolchain)|0|-|$log
|
||||
if [ "$allow_skip_cross" = 1 ]; then
|
||||
echo "skipped: no rustup toolchain at $cross_toolchain (tools/RELEASING.md)" >"$log"
|
||||
echo " skip $step (no rustup toolchain)"
|
||||
rows="$rows$step|SKIPPED (no toolchain)|0|-|$log
|
||||
"
|
||||
else
|
||||
echo "FAIL: no rustup toolchain at $cross_toolchain (tools/RELEASING.md); pass --allow-skip-cross to skip" >"$log"
|
||||
echo " fail $step (no rustup toolchain; pass --allow-skip-cross to skip)"
|
||||
t0=$(date +%s)
|
||||
printf '%s\t%s\t%s\t%s\n' "$step" "$t0" "$t0" "fail" >>"$log_dir/steps.tsv"
|
||||
rows="$rows$step|fail|0|-|$log
|
||||
"
|
||||
failed=1
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
echo " start $step ($(limits "$step" | sed 's/ / s, /') GB)"
|
||||
|
||||
Reference in new issue
Block a user