Files
Ho Ngoc Hai 26b6b37cee
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 12s
Deploy / Build AI Services Image (push) Failing after 10s
Security Scanning / Trivy Scan — API Image (push) Failing after 1m25s
Security Scanning / Trivy Scan — Web Image (push) Failing after 46s
Security Scanning / Trivy Scan — AI Services Image (push) Failing after 43s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Security Scanning / Security Gate (push) Failing after 1s
Deploy / Rollback Staging (push) Has been skipped
CI / E2E Tests (push) Has been skipped
CodeQL Analysis / CodeQL (javascript-typescript) (push) Failing after 32s
Deploy / Build API Image (push) Failing after 26s
Deploy / Build Web Image (push) Failing after 10s
E2E Tests / Playwright E2E (push) Failing after 21s
Security Scanning / Dependency Audit (pnpm) (push) Failing after 5s
Security Scanning / Trivy Filesystem Scan (push) Failing after 42s
Deploy / Rollback Production (push) Has been skipped
feat(qa): add smoke test suite + post-deploy workflow
- e2e/api/smoke.spec.ts — 9 @smoke API tests covering health, auth roundtrip,
  token refresh, listings, search, payments, subscriptions, and inquiries
- e2e/web/smoke.spec.ts — 7 @smoke Web tests covering homepage, login/register
  pages, listings, search, listing detail 404 handling, and console-error check
- playwright.config.ts — smoke-api and smoke-web projects (grep: /@smoke/)
  allowing targeted post-deploy execution without the full suite
- .github/workflows/smoke.yml — workflow_dispatch + workflow_call trigger for
  running only the @smoke subset against staging or production URLs

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-21 00:47:40 +07:00

104 lines
3.0 KiB
YAML

name: Smoke Tests (Post-Deploy)
on:
workflow_dispatch:
inputs:
environment:
description: 'Target environment'
required: true
default: 'staging'
type: choice
options:
- staging
- production
api_url:
description: 'API base URL (overrides default for env)'
required: false
type: string
web_url:
description: 'Web base URL (overrides default for env)'
required: false
type: string
workflow_call:
inputs:
environment:
required: false
type: string
default: 'staging'
api_url:
required: false
type: string
web_url:
required: false
type: string
concurrency:
group: smoke-${{ inputs.environment || 'staging' }}-${{ github.ref }}
cancel-in-progress: true
jobs:
smoke:
name: Smoke — ${{ inputs.environment || 'staging' }}
runs-on: ubuntu-latest
timeout-minutes: 10
env:
API_BASE_URL: ${{ inputs.api_url || (inputs.environment == 'production' && vars.PROD_API_URL) || vars.STAGING_API_URL || 'http://localhost:3001/api/v1/' }}
WEB_BASE_URL: ${{ inputs.web_url || (inputs.environment == 'production' && vars.PROD_WEB_URL) || vars.STAGING_WEB_URL || 'http://localhost:3000' }}
CI: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps chromium
- name: Install Playwright system deps
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps chromium
- name: Run smoke tests (API)
run: npx playwright test --project=smoke-api
env:
API_BASE_URL: ${{ env.API_BASE_URL }}
- name: Run smoke tests (Web)
run: npx playwright test --project=smoke-web
env:
WEB_BASE_URL: ${{ env.WEB_BASE_URL }}
API_BASE_URL: ${{ env.API_BASE_URL }}
- name: Upload smoke report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: smoke-report-${{ inputs.environment || 'staging' }}-${{ github.run_id }}
path: playwright-report/
retention-days: 7
- name: Notify failure
if: failure()
run: |
echo "::error::Smoke tests FAILED on ${{ inputs.environment || 'staging' }}. Check the uploaded playwright-report artifact for details."