diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 5c5e0683..cd43a3e7 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -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/