Skip to content

Merge pull request #569 from Emmanex01/feat/db-baseline-migrations #360

Merge pull request #569 from Emmanex01/feat/db-baseline-migrations

Merge pull request #569 from Emmanex01/feat/db-baseline-migrations #360

Workflow file for this run

name: E2E Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 15
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: myfans
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: |
frontend/package-lock.json
backend/package-lock.json
- name: Install backend dependencies
working-directory: backend
run: npm ci
- name: Install frontend dependencies
working-directory: frontend
run: npm ci
- name: Install Playwright browsers
working-directory: frontend
run: npx playwright install --with-deps chromium
- name: Start backend
working-directory: backend
run: |
npm run start:dev &
npx wait-on http://localhost:3001/v1/health -t 60000
env:
PORT: 3001
DB_HOST: localhost
DB_PORT: 5432
DB_USER: postgres
# DB_PASSWORD comes from the postgres service container (ephemeral, test-only)
DB_PASSWORD: ${{ secrets.E2E_DB_PASSWORD || 'postgres' }}
DB_NAME: myfans
# JWT_SECRET for E2E is a test-only value stored as a GitHub Secret.
# It is never shared with production and rotated independently.
JWT_SECRET: ${{ secrets.E2E_JWT_SECRET || 'test-secret-value-for-ci-only' }}
- name: Run E2E tests
working-directory: frontend
run: npm run test:e2e
env:
CI: true
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: frontend/playwright-report/
retention-days: 7