Skip to content

ci: Bump actions/checkout from 6 to 7 #113

ci: Bump actions/checkout from 6 to 7

ci: Bump actions/checkout from 6 to 7 #113

Workflow file for this run

name: E2E
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
e2e:
name: Playwright e2e tests
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install frontend dependencies
working-directory: frontend
run: npm ci
- name: Install Playwright browsers (chromium only)
working-directory: frontend
run: npx playwright install --with-deps chromium
- name: Create .env for stack
run: |
cp .env.example .env
# Override the AI key with empty — agent tests will be skipped in e2e flow
# (e2e specs use dev-token login, not agent calls)
sed -i 's/^JWT_SECRET_KEY=.*/JWT_SECRET_KEY=test-secret-key-for-e2e-only/' .env
# Disable rate limiting during e2e — Playwright fires many /auth/dev-token
# calls in quick succession from the same IP and will otherwise hit the
# 10/minute auth limit halfway through the suite.
sed -i 's/^RATE_LIMIT_ENABLED=.*/RATE_LIMIT_ENABLED=false/' .env
- name: Start stack with docker compose
run: |
docker compose up -d --build
echo "Containers:"
docker compose ps
- name: Wait for API health
run: |
timeout 180 bash -c 'until curl -sf http://localhost:8000/api/v1/health; do
echo "Waiting for API..."; sleep 3
done'
echo "API is healthy."
- name: Run database migrations
run: docker compose exec -T api alembic upgrade head
- name: Wait for frontend
run: |
timeout 120 bash -c 'until curl -sf http://localhost:3000 > /dev/null; do
echo "Waiting for frontend..."; sleep 3
done'
echo "Frontend is up."
- name: Run Playwright tests
working-directory: frontend
env:
# DB-helper-specs gebruiken `docker compose exec psql` voor directe
# asserties op de onderliggende tabellen. CI gebruikt POSTGRES_USER=ims
# (uit .env.example) i.p.v. de PG-default; geef die mee aan de tests.
POSTGRES_USER: ims
POSTGRES_DB: ims
run: npx playwright test
- name: Show container logs on failure
if: failure()
run: |
echo "=== API logs ==="
docker compose logs api | tail -100
echo "=== Frontend logs ==="
docker compose logs frontend | tail -100
echo "=== DB logs ==="
docker compose logs db | tail -50
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v7
with:
name: playwright-report
path: frontend/playwright-report/
retention-days: 14
if-no-files-found: ignore
- name: Stop stack
if: always()
run: docker compose down -v