devops: fix CI — Playwright Docker image + upload-artifact v3 #15

Merged
marcel merged 1 commits from devops/ci-fixes into main 2026-03-19 20:34:10 +01:00

View File

@@ -6,17 +6,16 @@ on:
jobs:
# ─── Unit & Browser Component Tests ──────────────────────────────────────────
# No backend needed — Vitest runs in Node (utils) and headless Chromium (components).
# Runs inside the official Playwright Docker image — Chromium and all system
# deps are pre-installed, so no install or cache step is needed for the browser.
unit-tests:
name: Unit & Component Tests
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.58.2-noble
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache node_modules
id: node-modules-cache
uses: actions/cache@v4
@@ -29,30 +28,13 @@ jobs:
run: npm ci
working-directory: frontend
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-chromium-${{ hashFiles('frontend/package-lock.json') }}
- name: Install Playwright Chromium + system deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install chromium --with-deps
working-directory: frontend
- name: Install Playwright system deps (browser binary already cached)
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps chromium
working-directory: frontend
- name: Run unit and component tests
run: npm test
working-directory: frontend
- name: Upload screenshots
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: unit-test-screenshots
path: frontend/test-results/screenshots/
@@ -207,7 +189,7 @@ jobs:
- name: Upload E2E results
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: e2e-results
path: frontend/test-results/e2e/