Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Playwright

on:
push:
pull_request:

permissions:
contents: read
checks: write
pull-requests: write

env:
PLAYWRIGHT_VERSION: '1.60.0'

jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 45

steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
submodules: recursive

- name: Prepare local directories
run: |
chmod +x .docker/*.sh setup.sh
./setup.sh

- name: Start application stack
run: docker compose up -d --build

- name: Wait for application
run: |
echo "Waiting for http://localhost:8000 ..."
for i in $(seq 1 60); do
if curl -sf http://localhost:8000/ > /dev/null; then
echo "Application is ready."
exit 0
fi
echo "Attempt ${i}/60: application not ready yet."
sleep 10
done
echo "Application failed to become ready in time."
docker compose ps
docker compose logs app --tail 200
exit 1

- name: Run Playwright tests
run: |
docker run --rm \
--network host \
--ipc=host \
-v "${{ github.workspace }}/e2e:/e2e" \
-w /e2e \
-e BASE_URL=http://localhost:8000 \
-e CI=true \
mcr.microsoft.com/playwright:v${{ env.PLAYWRIGHT_VERSION }}-jammy \
sh -c "npm ci && npm test"

- name: Publish Playwright test results
uses: dorny/test-reporter@v3
if: always() && !cancelled()
with:
name: Playwright Tests
path: e2e/test-results/junit.xml
reporter: java-junit
fail-on-error: true
use-actions-summary: true

- name: Upload JUnit results
if: always() && !cancelled()
uses: actions/upload-artifact@v6
with:
name: playwright-junit
path: e2e/test-results/junit.xml
retention-days: 14
if-no-files-found: ignore

- name: Upload application logs
if: failure()
run: docker compose logs --no-color > docker-compose.log

- name: Store application logs
if: failure()
uses: actions/upload-artifact@v6
with:
name: docker-compose-logs
path: docker-compose.log
retention-days: 7
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@
config/Migrations/schema-dump-default.lock
/html
.vscode/settings.json
/e2e/node_modules
/e2e/playwright-report
/e2e/test-results
/e2e/blob-report
/e2e/playwright/.cache
Loading