fix(cd): install playwright system deps for smoke
This commit is contained in:
@@ -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 \
|
||||
|
||||
@@ -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`。
|
||||
|
||||
Reference in New Issue
Block a user