Skip to content

Commit 9f5c0fa

Browse files
committed
ci: build echo-bot before the serve smoke test
1 parent 257629d commit 9f5c0fa

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/examples-js.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,23 @@ jobs:
169169
run: |
170170
set -e
171171
npm install --no-audit --no-fund --ignore-scripts
172+
# serve runs the prebuilt wasm — in its own job there's no earlier
173+
# build step, so build echo-bot first (the template's serve script
174+
# likewise does `build && serve`).
175+
npx --no-install owncast-plugin build
172176
PORT=8099 npx --no-install owncast-plugin serve . > /tmp/serve.log 2>&1 &
173177
pid=$!
178+
ready=
174179
for i in $(seq 1 40); do
175-
curl -fsS http://localhost:8099/_dev/chat >/dev/null 2>&1 && break
180+
curl -fsS http://localhost:8099/_dev/chat >/dev/null 2>&1 && { ready=1; break; }
176181
sleep 0.5
177182
done
183+
if [ -z "$ready" ]; then
184+
echo "::error::serve smoke test: server never became ready on :8099"
185+
cat /tmp/serve.log
186+
kill "$pid" 2>/dev/null || true
187+
exit 1
188+
fi
178189
curl -fsS -X POST http://localhost:8099/_dev/chat \
179190
-H 'Content-Type: application/json' \
180191
-d '{"user":"alice","body":"hi"}' >/dev/null

0 commit comments

Comments
 (0)