Files
basil/.gitea/workflows/e2e.yml
Paul R Kartchner 554b53bec7
Some checks failed
CI Pipeline / Lint Code (push) Has been cancelled
CI Pipeline / Test API Package (push) Has been cancelled
CI Pipeline / Test Web Package (push) Has been cancelled
CI Pipeline / Test Shared Package (push) Has been cancelled
CI Pipeline / Build All Packages (push) Has been cancelled
CI Pipeline / Generate Coverage Report (push) Has been cancelled
Docker Build & Deploy / Build Docker Images (push) Has been cancelled
Docker Build & Deploy / Push Docker Images (push) Has been cancelled
Docker Build & Deploy / Deploy to Staging (push) Has been cancelled
Docker Build & Deploy / Deploy to Production (push) Has been cancelled
E2E Tests / End-to-End Tests (push) Has been cancelled
E2E Tests / E2E Tests (Mobile) (push) Has been cancelled
Security Scanning / NPM Audit (push) Has been cancelled
Security Scanning / Dependency License Check (push) Has been cancelled
Security Scanning / Code Quality Scan (push) Has been cancelled
Security Scanning / Docker Image Security (push) Has been cancelled
Security Scanning / Security Summary (push) Has been cancelled
feat: add comprehensive testing infrastructure
- Add Vitest for unit testing across all packages
- Add Playwright for E2E testing
- Add sample tests for API, Web, and Shared packages
- Configure Gitea Actions CI/CD workflows (ci, e2e, security, docker)
- Add testing documentation (TESTING.md)
- Add Gitea Actions setup guide
- Update .gitignore for test artifacts
- Add test environment configuration
2025-10-28 02:03:52 -06:00

149 lines
3.5 KiB
YAML

name: E2E Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
schedule:
# Run E2E tests nightly at 2 AM UTC
- cron: '0 2 * * *'
jobs:
e2e-tests:
name: End-to-End Tests
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: basil
POSTGRES_PASSWORD: basil
POSTGRES_DB: basil
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Build packages
run: npm run build
- name: Run database migrations
working-directory: packages/api
env:
DATABASE_URL: postgresql://basil:basil@localhost:5432/basil
run: npm run prisma:migrate
- name: Start application
env:
DATABASE_URL: postgresql://basil:basil@localhost:5432/basil
PORT: 3001
NODE_ENV: test
run: |
npm run dev &
sleep 10
- name: Run E2E tests
run: npm run test:e2e
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 14
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-results
path: test-results/
retention-days: 7
e2e-mobile:
name: E2E Tests (Mobile)
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: basil
POSTGRES_PASSWORD: basil
POSTGRES_DB: basil
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Build packages
run: npm run build
- name: Run database migrations
working-directory: packages/api
env:
DATABASE_URL: postgresql://basil:basil@localhost:5432/basil
run: npm run prisma:migrate
- name: Start application
env:
DATABASE_URL: postgresql://basil:basil@localhost:5432/basil
PORT: 3001
NODE_ENV: test
run: |
npm run dev &
sleep 10
- name: Run E2E tests on mobile
run: npx playwright test --project="Mobile Chrome" --project="Mobile Safari"
- name: Upload mobile test results
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-mobile-results
path: test-results/
retention-days: 7