73da1859fe
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m1s
**Changes:** 1. **Blazor Prerendering** (App.razor) - prerender: false → true - Eliminates white screen on page load - Initial HTML rendered immediately 2. **Deployment Health Check** (.gitea/workflows/deploy.yml) - Timeout: 120s → 60s (ATTEMPTS: 40 → 20) - Fail fast on deployment issues 3. **E2E Deployment Wait** (.gitea/workflows/browser-e2e.yml) - Timeout: 150s → 60s (retries: 30 → 20) - Interval: 5s → 3s between checks - Desktop Chrome only (skip mobile projects in CI) 4. **Playwright Optimization** (playwright.config.ts) - CI parallel: fullyParallel: false → true - Disable retries: CI retries: 1 → 0 (fail fast) - Allow immediate failure detection **Expected Impact:** - Total CI time: 60+ min → 15-25 min (-75%) - Health check: 2 min → 1 min - E2E tests: 4 projects → 1 project - Explicit timeout rules at all levels **Files:** - playwright.config.ts: Parallel mode + no retries - deploy.yml: 20 health check attempts (60s max) - browser-e2e.yml: 20 deployment wait retries (60s max) - CLAUDE.md: CI/CD optimization documented Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
86 lines
3.0 KiB
YAML
86 lines
3.0 KiB
YAML
name: TaxBaik Browser E2E
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["TaxBaik CI/CD"]
|
|
types:
|
|
- completed
|
|
|
|
jobs:
|
|
browser-e2e:
|
|
runs-on: ubuntu-latest
|
|
if: github.event.workflow_run.conclusion == 'success'
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
cache: npm
|
|
|
|
- name: Cache Playwright browsers
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cache/ms-playwright
|
|
key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-playwright-
|
|
|
|
- name: Install Playwright dependencies
|
|
run: |
|
|
set -e
|
|
npm ci
|
|
npx playwright install chromium --with-deps
|
|
|
|
- name: Wait for deployment
|
|
env:
|
|
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
|
EXPECTED_VERSION: ${{ github.event.workflow_run.head_sha }}
|
|
run: |
|
|
set -e
|
|
# Extract short commit hash (first 7 characters)
|
|
SHORT_VERSION=$(echo "$EXPECTED_VERSION" | cut -c1-7)
|
|
echo "Expected short version: $SHORT_VERSION"
|
|
for i in $(seq 1 20); do
|
|
# Suppress stderr and allow failures to handle transition/down periods cleanly
|
|
VERSION_BODY="$(curl -fsS "http://${DEPLOY_HOST}/taxbaik/version.json" 2>/dev/null || true)"
|
|
BLOG_STATUS="$(curl -s -o /dev/null -w '%{http_code}' "http://${DEPLOY_HOST}/taxbaik/blog/accountant-mistakes-5" || true)"
|
|
if echo "$VERSION_BODY" | grep -q "\"version\": \"${SHORT_VERSION}\"" && [ "$BLOG_STATUS" = "200" ]; then
|
|
echo "✓ Deployment ready for ${SHORT_VERSION} (attempt $i/20)"
|
|
exit 0
|
|
fi
|
|
if [ $i -lt 20 ]; then
|
|
echo " Attempt $i/20: waiting for deployment... (blog=${BLOG_STATUS:-?}, version=${VERSION_BODY:0:30}...)"
|
|
sleep 3
|
|
fi
|
|
done
|
|
echo "✗ TIMEOUT: Deployment failed to publish ${SHORT_VERSION} within 60 seconds" >&2
|
|
exit 1
|
|
|
|
- name: Browser E2E verification
|
|
env:
|
|
# Green-Blue 배포 지원: Nginx를 통해 active 포트로 라우팅
|
|
E2E_BASE_URL: http://${{ secrets.DEPLOY_HOST }}/taxbaik
|
|
# E2E 테스트는 test_admin 테스트 계정 사용 (실 admin 계정과 분리)
|
|
E2E_ADMIN_USERNAME: test_admin
|
|
E2E_ADMIN_PASSWORD: TestAdmin@123456
|
|
run: |
|
|
echo "Running E2E tests on Desktop Chrome (production verification)"
|
|
npx playwright test --project="Desktop Chrome" --reporter=html --reporter=list
|
|
|
|
- name: Browser E2E summary
|
|
if: always()
|
|
run: |
|
|
echo "Executed tests:"
|
|
echo "- admin-login"
|
|
echo "- admin-smoke"
|
|
echo "- public-smoke"
|
|
echo "- blog-seo"
|
|
echo "- contact-submit"
|
|
echo "- inquiry-detail"
|
|
echo "- admin-password-change"
|