From 4142c7cd8314a644d703df51088aa4c078124596 Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 19 Mar 2026 17:17:53 +0100 Subject: [PATCH] devops: fix upload-artifact and use Playwright Docker image for unit tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Switch unit-tests job to mcr.microsoft.com/playwright:v1.58.2-noble container; Chromium and all system deps are pre-installed so the browser install/cache dance is eliminated entirely (closes #13) - Downgrade upload-artifact@v4 → v3 in both unit-tests and e2e-tests jobs; v4 is not supported on Gitea (GHES) and was causing jobs to report failure even when all tests passed, and prevented the Playwright browser cache from ever being saved (closes #14) Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/ci.yml | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) 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/ -- 2.49.1