Skip to content

Commit 8150934

Browse files
committed
Smoke test built site in CI
1 parent 24b9ff5 commit 8150934

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,24 @@ jobs:
3737
- name: Build site
3838
run: npm run build
3939

40+
- name: Smoke test built site
41+
run: |
42+
npx --yes serve@14.2.4 build --listen 3000 &
43+
server_pid=$!
44+
trap 'kill "$server_pid"' EXIT
45+
46+
for attempt in {1..30}; do
47+
if curl --fail --silent --show-error http://127.0.0.1:3000/ > /tmp/home.html; then
48+
break
49+
fi
50+
sleep 1
51+
done
52+
53+
test -s /tmp/home.html
54+
grep -q "GraphQL Java" /tmp/home.html
55+
56+
curl --fail --silent --show-error http://127.0.0.1:3000/documentation/getting-started > /tmp/docs.html
57+
grep -q "Getting started" /tmp/docs.html
58+
4059
- name: Audit high-risk dependencies
4160
run: npm audit --omit=dev --audit-level=high

0 commit comments

Comments
 (0)