Skip to content

Commit d073241

Browse files
dmealingclaude
andcommitted
fix(ci): retry bun install once — optional-dep exit-1 flake reds fresh-checkout gates
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SKaSE8U5cwN4ZGFwhJwxSY
1 parent c77be1b commit d073241

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

scripts/ci-local.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ want() { # want <section> — true when the section should run
7777
PASS=(); FAIL=(); SKIP=()
7878
have() { command -v "$1" >/dev/null 2>&1; }
7979

80+
# bun's installer exits 1 when an OPTIONAL native dep fails to build (e.g. the
81+
# ssh2/cpu-features chain) even though the workspace is fully usable — and an
82+
# immediate re-run exits 0. Retry once so fresh checkouts (the self-hosted CI
83+
# runner wipes its workdir every run) don't fail the gate on that flake; a
84+
# genuinely broken install still fails both attempts.
85+
bun_install() { bun install || bun install; }
86+
8087
step() { # step "<name>" <cmd...>
8188
local name="$1"; shift
8289
echo ""
@@ -106,13 +113,13 @@ gate_pom_versions() { scripts/check-pom-versions.sh; }
106113

107114
# ── conformance.yml — fixture lint + workspace typecheck ──────────────────────
108115
gate_fixture_lint() {
109-
bun install && ( cd server/typescript/packages/conformance && bun bin/conformance.ts lint ../../../../fixtures/conformance )
116+
bun_install && ( cd server/typescript/packages/conformance && bun bin/conformance.ts lint ../../../../fixtures/conformance )
110117
}
111118
gate_ts_build_typecheck() { bun run --filter '*' build && bun run --filter '*' typecheck; }
112119

113120
# ── conformance.yml — per-port conformance corpora (exact CI commands) ────────
114121
gate_conf_ts() {
115-
bun install || return 1
122+
bun_install || return 1
116123
( cd server/typescript/packages/metadata && bun test test/conformance.test.ts test/yaml-conformance.test.ts test/object-model-conformance.test.ts \
117124
&& bun test test/registry-conformance.test.ts test/registry-coverage.test.ts ) || return 1
118125
( cd server/typescript/packages/render && bun test test/render-conformance.test.ts test/verify-conformance.test.ts test/extract/extract-conformance.test.ts test/output-prompt-conformance.test.ts ) || return 1

0 commit comments

Comments
 (0)