Pulse/.github/workflows/test-e2e.yml
2026-04-22 10:12:15 +01:00

101 lines
2.9 KiB
YAML

name: Core E2E Tests
on:
pull_request:
branches:
- main
paths:
- 'frontend-modern/**'
- 'internal/**'
- 'tests/integration/**'
- 'Dockerfile'
- '.github/workflows/test-e2e.yml'
push:
branches:
- main
- master
paths:
- 'frontend-modern/**'
- 'internal/**'
- 'tests/integration/**'
- 'Dockerfile'
- '.github/workflows/test-e2e.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
e2e:
name: Playwright Core E2E
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: tests/integration/package-lock.json
- name: Install Playwright dependencies
working-directory: tests/integration
run: |
npm ci
npx playwright install --with-deps chromium
- name: Build Docker images for test environment
run: |
docker build -t pulse-mock-github:test ./tests/integration/mock-github-server
env:
PULSE_LICENSE_PUBLIC_KEY: ${{ secrets.PULSE_LICENSE_PUBLIC_KEY }}
- name: Start test containers
working-directory: tests/integration
env:
PULSE_E2E_BOOTSTRAP_TOKEN: 0123456789abcdef0123456789abcdef0123456789abcdef
PULSE_E2E_SKIP_PLAYWRIGHT_INSTALL: "true"
PULSE_MULTI_TENANT_ENABLED: "true"
run: node scripts/pretest.mjs
- name: Run E2E suite
working-directory: tests/integration
env:
PULSE_E2E_BOOTSTRAP_TOKEN: 0123456789abcdef0123456789abcdef0123456789abcdef
PULSE_E2E_SKIP_DOCKER: "true"
PULSE_E2E_SKIP_PLAYWRIGHT_INSTALL: "true"
PULSE_E2E_PERF: "1"
run: npm test
- name: Collect container logs
if: always()
working-directory: tests/integration
run: |
echo "=== Docker containers ==="
docker ps -a
echo "=== Pulse test server logs ==="
docker logs pulse-test-server 2>&1 || echo "No pulse-test-server container"
echo "=== Mock GitHub server logs ==="
docker logs pulse-mock-github 2>&1 || echo "No pulse-mock-github container"
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: playwright-report
path: tests/integration/playwright-report/
retention-days: 30
- name: Upload test videos and screenshots
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: test-failures
path: tests/integration/test-results/
retention-days: 7