simplify(ci): create minimal security-focused workflow #43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: E2E Tests | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| e2e-tests: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:14 | |
| env: | |
| POSTGRES_PASSWORD: test_password | |
| POSTGRES_USER: test_user | |
| POSTGRES_DB: brightroute_test | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| - name: Setup environment variables | |
| run: | | |
| cp .env.example .env | |
| echo "DATABASE_URL=postgresql://test_user:test_password@localhost:5432/brightroute_test" >> .env | |
| echo "JWT_SECRET=test-jwt-secret-for-ci" >> .env | |
| echo "NODE_ENV=test" >> .env | |
| - name: Setup database | |
| run: | | |
| cd backend | |
| npx prisma migrate deploy | |
| npx prisma db seed | |
| - name: Build applications | |
| run: | | |
| npm run build:frontend | |
| npm run build:backend | |
| - name: Run Playwright tests | |
| run: npm run test:e2e | |
| - uses: actions/upload-artifact@v3 | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 | |
| - uses: actions/upload-artifact@v3 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: test-results/ | |
| retention-days: 30 |