Part 6 pw #1
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 with Local Supabase | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| e2e-tests: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: postgres | |
| 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: '18' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Supabase CLI | |
| run: | | |
| curl -fsSL https://github.com/supabase/cli/releases/download/v1.123.4/supabase_linux_amd64.tar.gz | tar -xz | |
| sudo mv supabase /usr/local/bin/ | |
| - name: Start Supabase local instance | |
| run: | | |
| supabase start | |
| sleep 10 | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps | |
| - name: Start Angular app | |
| run: | | |
| npm run start:local & | |
| sleep 30 | |
| # Wait for app to be ready | |
| timeout 60 bash -c 'until curl -f http://localhost:4200; do sleep 2; done' | |
| - name: Run E2E tests | |
| run: npm run e2e:local | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 | |
| - name: Stop services | |
| if: always() | |
| run: | | |
| # Kill Angular dev server | |
| pkill -f "ng serve" || true | |
| # Stop Supabase | |
| supabase stop || true |