diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index dfdf2fb6..d92cdc82 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -16,17 +16,36 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 20 - cache: npm - cache-dependency-path: frontend/package-lock.json + + - name: Cache node_modules + id: node-modules-cache + uses: actions/cache@v4 + with: + path: frontend/node_modules + key: node-modules-${{ hashFiles('frontend/package-lock.json') }} - name: Install dependencies + if: steps.node-modules-cache.outputs.cache-hit != 'true' run: npm ci working-directory: frontend - - name: Install Playwright Chromium (used by vitest browser mode) + - 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 @@ -131,17 +150,36 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 20 - cache: npm - cache-dependency-path: frontend/package-lock.json + + - name: Cache node_modules + id: node-modules-cache + uses: actions/cache@v4 + with: + path: frontend/node_modules + key: node-modules-${{ hashFiles('frontend/package-lock.json') }} - name: Install frontend dependencies + if: steps.node-modules-cache.outputs.cache-hit != 'true' run: npm ci working-directory: frontend - - name: Install Playwright Chromium + - 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 + # ── Tests ──────────────────────────────────────────────────────────────── - name: Run E2E tests run: npm run test:e2e