Skip to content

Merge pull request #1086 from peterjoshua482-netizen/fix/market-reent… #1

Merge pull request #1086 from peterjoshua482-netizen/fix/market-reent…

Merge pull request #1086 from peterjoshua482-netizen/fix/market-reent… #1

Workflow file for this run

name: Playwright E2E Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
e2e:
name: Playwright Tests
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: brainstorm_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:7
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
env:
# Backend
NODE_ENV: test
DATABASE_HOST: localhost
DATABASE_PORT: 5432
DATABASE_USER: postgres
DATABASE_PASSWORD: postgres
DATABASE_NAME: brainstorm_test
REDIS_URL: redis://localhost:6379
JWT_SECRET: ci-test-secret
STELLAR_HORIZON_URL: https://horizon-testnet.stellar.org
# Frontend
NEXT_PUBLIC_API_URL: http://localhost:3000
PLAYWRIGHT_BASE_URL: http://localhost:3001
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
# ── Backend ──────────────────────────────────────────────────────────────
- name: Install deps (root)
run: npm ci
- name: Build backend
run: npm run build --workspace=apps/backend
- name: Run migrations
run: npm run migration:run --workspace=apps/backend
- name: Start backend
run: npm run start:prod --workspace=apps/backend &
# ── Frontend ─────────────────────────────────────────────────────────────
- name: Build frontend
run: npm run build --workspace=apps/frontend
- name: Start frontend
run: npm run start --workspace=apps/frontend -- --port 3001 &
- name: Wait for services
run: |
npx wait-on http://localhost:3000/health http://localhost:3001 --timeout 60000
# ── Playwright ───────────────────────────────────────────────────────────
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium firefox
working-directory: apps/frontend
- name: Run Playwright tests
run: npm run test:e2e:ci --workspace=apps/frontend
- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: apps/frontend/playwright-report/
retention-days: 14