chore: add gui smoke check

This commit is contained in:
2026-06-04 07:49:34 +08:00
parent cc157a2d36
commit 20e605bab7
3 changed files with 48 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
#!/bin/bash
# Static GUI smoke check for Wails/Svelte builds.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
GUI_BUILD_OUT="${GUI_BUILD_OUT:-/tmp/verstak-gui-check}"
echo "=== Checking GUI locale/source hygiene ==="
"$ROOT/scripts/check-i18n.sh"
echo ""
echo "=== Building frontend production bundle ==="
(cd "$ROOT/frontend" && npm run build)
echo ""
echo "=== Checking embedded Wails assets ==="
if [ ! -d "$ROOT/cmd/verstak-gui/frontend-dist" ]; then
echo "FAIL: cmd/verstak-gui/frontend-dist is missing"
echo "Run ./scripts/build.sh gui and commit the embedded assets."
exit 1
fi
if ! diff -qr "$ROOT/frontend/dist" "$ROOT/cmd/verstak-gui/frontend-dist"; then
echo ""
echo "FAIL: embedded Wails assets are stale."
echo "Run ./scripts/build.sh gui and commit cmd/verstak-gui/frontend-dist."
exit 1
fi
echo "OK: embedded Wails assets match frontend/dist"
echo ""
echo "=== Compiling GUI binary ==="
go build -tags "webkit2_41 desktop production" -ldflags="-s -w" -o "$GUI_BUILD_OUT" "$ROOT/cmd/verstak-gui/"
echo "OK: GUI smoke check passed"