Skip to content

Part 6 pw

Part 6 pw #7

Workflow file for this run

name: E2E Tests with Local Supabase
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
e2e:
runs-on: ubuntu-latest
# Cancel older, still-running copies of the same PR/branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
services:

Check failure on line 17 in .github/workflows/e2e-tests.yml

View workflow run for this annotation

GitHub Actions / E2E Tests with Local Supabase

Invalid workflow file

The workflow is not valid. .github/workflows/e2e-tests.yml (Line: 17, Col: 14): Unexpected value ''
# Optional: expose Postgres port for psql debug sessions
# postgres:
# image: postgres:15-alpine
# ports: [54322:5432]
steps:
- name: 📥 Checkout sources
uses: actions/checkout@v4
- name: 🧰 Use Node 20 LTS
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: 🏗️ Install project dependencies
run: npm ci
# ---------- SUPABASE ----------
- name: 🛠️ Install Supabase CLI
uses: supabase/setup-cli@v1 # installs a pinned version
with:
version: 1.160.6 # keep in sync with local dev
# :contentReference[oaicite:3]{index=3}
- name: 🚀 Start local Supabase stack
# “--no-analytics” = skip telemetry; background (&)
run: supabase start --no-analytics &
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN || '' }}
# ^ token only needed if you sync migrations against the cloud project
- name: ⏱️ Wait for Supabase ports to be ready
# waits up to 2 min for 54321 (API) and 54322 (DB)
run: npx wait-on tcp:54321 tcp:54322 --timeout 120000
- name: 🌱 Seed fresh database
run: psql -h localhost -p 54322 -U postgres -f supabase/seed/seed.sql
env:
PGPASSWORD: postgres # default local password
# Optional: expose keys for tests that use env vars
- name: 🔑 Export Supabase env vars
run: |
echo "SUPABASE_URL=http://localhost:54321" >> $GITHUB_ENV
echo "SUPABASE_ANON_KEY=super-secret-anon-key" >> $GITHUB_ENV
# Local anon/service keys are static. If you rotate them, inject here.
# :contentReference[oaicite:4]{index=4}
# ---------- PLAYWRIGHT ----------
- name: 📦 Install Playwright browsers
run: npx playwright install --with-deps # installs Chromium, FF, WK
- name: 🧪 Run Angular 19 E2E tests
run: npm run e2e:local
env:
CI: true # enables retries/screenshots
# ---------- REPORT ----------
- name: 📊 Upload Playwright HTML report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report