devops: fix upload-artifact and use Playwright Docker image for unit tests
Some checks failed
CI / Unit & Component Tests (pull_request) Successful in 1m54s
CI / Backend Unit Tests (pull_request) Successful in 2m4s
CI / E2E Tests (pull_request) Failing after 17m35s
CI / Backend Unit Tests (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CI / Unit & Component Tests (push) Has been cancelled
Some checks failed
CI / Unit & Component Tests (pull_request) Successful in 1m54s
CI / Backend Unit Tests (pull_request) Successful in 2m4s
CI / E2E Tests (pull_request) Failing after 17m35s
CI / Backend Unit Tests (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CI / Unit & Component Tests (push) Has been cancelled
- 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 <noreply@anthropic.com>
This commit was merged in pull request #15.
This commit is contained in:
@@ -6,17 +6,16 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# ─── Unit & Browser Component Tests ──────────────────────────────────────────
|
# ─── 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:
|
unit-tests:
|
||||||
name: Unit & Component Tests
|
name: Unit & Component Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: mcr.microsoft.com/playwright:v1.58.2-noble
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
|
|
||||||
- name: Cache node_modules
|
- name: Cache node_modules
|
||||||
id: node-modules-cache
|
id: node-modules-cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -29,30 +28,13 @@ jobs:
|
|||||||
run: npm ci
|
run: npm ci
|
||||||
working-directory: frontend
|
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
|
- name: Run unit and component tests
|
||||||
run: npm test
|
run: npm test
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
- name: Upload screenshots
|
- name: Upload screenshots
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: unit-test-screenshots
|
name: unit-test-screenshots
|
||||||
path: frontend/test-results/screenshots/
|
path: frontend/test-results/screenshots/
|
||||||
@@ -207,7 +189,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload E2E results
|
- name: Upload E2E results
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: e2e-results
|
name: e2e-results
|
||||||
path: frontend/test-results/e2e/
|
path: frontend/test-results/e2e/
|
||||||
|
|||||||
Reference in New Issue
Block a user