fix(cd): install playwright system deps for smoke
All checks were successful
CD Pipeline / tests (push) Successful in 1m34s
Code Review / ai-code-review (push) Successful in 24s
CD Pipeline / build-and-deploy (push) Successful in 6m58s
CD Pipeline / post-deploy-checks (push) Successful in 3m7s

This commit is contained in:
Your Name
2026-04-30 11:02:12 +08:00
parent e27b462bef
commit 4723499955
2 changed files with 11 additions and 0 deletions

View File

@@ -790,6 +790,16 @@ jobs:
else
echo "⚡ 使用快取 Playwright Chromium ($PLAYWRIGHT_VER)"
fi
# Browser cache 命中時也要確認 OS shared libs 存在;否則 smoke 會只測到
# chromium launch failure例如 libnspr4.so missing
if ! ldconfig -p 2>/dev/null | grep -q 'libnspr4'; then
echo "📦 Playwright system deps missing補安裝 Chromium deps..."
npx playwright install-deps chromium > /tmp/playwright-install-deps.log 2>&1 || {
tail -40 /tmp/playwright-install-deps.log
exit 1
}
tail -20 /tmp/playwright-install-deps.log
fi
# 對已部署的生產環境跑 smoke test
npx playwright test tests/e2e/smoke.spec.ts --reporter=line \
&& echo "smoke_status=pass" >> $GITHUB_OUTPUT \

View File

@@ -16,6 +16,7 @@
- `scripts/ops/docker-health-monitor.sh` 預設排除 `gitea-runner`,避免 Docker 自動修復把已停用 runner container 每 5 分鐘拉起。
- `.gitea/workflows/cd.yaml` 拆為 `tests``build-and-deploy``post-deploy-checks` 三段API/Web Docker build 與 GitOps deploy 改跑 `awoooi-host`,不再在 transient act job container 內長時間 build。
- host deploy step 的 `kustomize` 改安裝到 `${HOME}/.local/bin`,避免 host runner 沒有 root 權限時寫 `/usr/local/bin` 失敗。
- post-deploy Playwright smoke 在 browser cache 命中時也會檢查 OS shared libs`libnspr4.so` 等 Chromium 依賴時自動補 `install-deps`
### 驗證
- 110 act_runner 已宣告 labels: `ubuntu-latest ubuntu-22.04 ubuntu-24.04 awoooi-host`