Skip to content

Commit 38ca19e

Browse files
authored
ci: add smoke tests for compiled binaries in release pipeline (#555)
Runs three checks on the linux-x64 binary after compilation, before artifact upload: --help (binary loads), review server startup (full import chain + bundled HTML + git integration + HTTP binding), and annotate server startup. Catches the class of build breakage where compilation succeeds but the binary crashes on launch. For provenance purposes, this commit was AI assisted.
1 parent c2dadc9 commit 38ca19e

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,44 @@ jobs:
116116
bun build apps/paste-service/targets/bun.ts --compile --target=bun-windows-arm64 --outfile plannotator-paste-win32-arm64.exe
117117
sha256sum plannotator-paste-win32-arm64.exe > plannotator-paste-win32-arm64.exe.sha256
118118
119+
- name: Smoke-test linux-x64 binary
120+
run: |
121+
chmod +x plannotator-linux-x64
122+
123+
# 1. --help: proves binary loads and arg parsing works
124+
./plannotator-linux-x64 --help
125+
126+
# Helper: start server, poll endpoint for 200, kill
127+
smoke_test_server() {
128+
local LABEL="$1" PORT="$2" ENDPOINT="$3"
129+
shift 3
130+
# Start the binary in background
131+
PLANNOTATOR_PORT=$PORT "$@" &
132+
local PID=$!
133+
# Poll until the API responds (up to 10s)
134+
local OK=0
135+
for i in $(seq 1 20); do
136+
if curl -sf "http://localhost:${PORT}${ENDPOINT}" -o /dev/null 2>/dev/null; then
137+
OK=1; break
138+
fi
139+
sleep 0.5
140+
done
141+
kill $PID 2>/dev/null; wait $PID 2>/dev/null || true
142+
if [ "$OK" = "0" ]; then
143+
echo "FAIL: $LABEL did not respond on :${PORT}${ENDPOINT}"
144+
exit 1
145+
fi
146+
echo "OK: $LABEL — :${PORT}${ENDPOINT} responded"
147+
}
148+
149+
# 2. review: exercises full server startup (imports, bundled HTML, git diff, HTTP)
150+
smoke_test_server "plannotator review" 19500 "/api/diff" \
151+
./plannotator-linux-x64 review
152+
153+
# 3. annotate: exercises annotate server path with a real file
154+
smoke_test_server "plannotator annotate" 19501 "/api/plan" \
155+
./plannotator-linux-x64 annotate README.md
156+
119157
- name: Upload artifacts
120158
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
121159
with:

0 commit comments

Comments
 (0)