Skip to content

Feature: Add e2e tests + Occurence fixes (#1276) #2

Feature: Add e2e tests + Occurence fixes (#1276)

Feature: Add e2e tests + Occurence fixes (#1276) #2

Workflow file for this run

name: E2E Tests
on:
push:
branches: [main, develop, 'v[0-9]+.[0-9]+.[0-9]+-*']
paths:
- 'backend/**'
- 'frontend/**'
- 'e2e/**'
- 'docker/e2e/**'
- '.github/workflows/e2e.yml'
pull_request:
paths:
- 'backend/**'
- 'frontend/**'
- 'e2e/**'
- 'docker/e2e/**'
- '.github/workflows/e2e.yml'
concurrency:
group: e2e-${{ github.ref }}
cancel-in-progress: true
jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
COMPOSE_FILE: docker/e2e/docker-compose.e2e.yml
E2E_IMAGE_TAG: ci
STRIPE_PUBLIC_KEY: ${{ secrets.STRIPE_TEST_PUBLIC_KEY }}
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_TEST_SECRET_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build backend image
uses: docker/build-push-action@v6
with:
context: ./backend
file: ./backend/Dockerfile
load: true
tags: hievents-e2e-backend:ci
cache-from: type=gha,scope=e2e-backend
cache-to: type=gha,scope=e2e-backend,mode=max
- name: Build frontend image
uses: docker/build-push-action@v6
with:
context: ./frontend
file: ./frontend/Dockerfile.ssr
load: true
tags: hievents-e2e-frontend:ci
cache-from: type=gha,scope=e2e-frontend
cache-to: type=gha,scope=e2e-frontend,mode=max
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: e2e/package-lock.json
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('e2e/package-lock.json') }}
- name: Run E2E suite
run: ./e2e/run-e2e.sh
- name: Collect stack logs on failure
if: failure()
run: docker compose -f "$COMPOSE_FILE" logs --no-color > e2e/compose-logs.txt
- name: Upload report and artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: |
e2e/playwright-report/
e2e/test-results/
e2e/compose-logs.txt
retention-days: 14
- name: Tear down the stack
if: always()
run: docker compose -f "$COMPOSE_FILE" down -v