19 lines
812 B
Bash
19 lines
812 B
Bash
#!/usr/bin/env bash
|
|
# task_0001 萤火落地与预览退役:构建 + 产物断言 + lint + E2E
|
|
set -euo pipefail
|
|
cd "$(git rev-parse --show-toplevel)"
|
|
export PATH="$HOME/.local/node/bin:$PATH"
|
|
pnpm astro build >/dev/null 2>&1
|
|
[ ! -f src/pages/heatmap-preview.astro ]
|
|
[ ! -d src/components/geek/hm ]
|
|
! grep -q heatmap-preview scripts/build-perf/content-lint.mjs
|
|
! grep -q hm-head src/components/geek/Heatmap.astro
|
|
[ "$(grep -o 'class="hm-fly"' dist/opensource/index.html | wc -l)" -eq 4 ]
|
|
node scripts/build-perf/content-lint.mjs dist 2>&1 | grep -q "通过"
|
|
nohup python3 scripts/build-perf/gz-server.py 18925 "$PWD/dist" >/tmp/gz-5m.log 2>&1 &
|
|
SRV=$!
|
|
sleep 2
|
|
trap 'kill $SRV 2>/dev/null || true' EXIT
|
|
E2E_BASE=http://127.0.0.1:18925 node tests/e2e.mjs 2>&1 | grep -qE "汇总: 61/61 PASS"
|
|
echo "verify_t1 OK"
|