From 409e70078c1c351bfb0601dba3463760a429d3f3 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 17 Mar 2026 22:03:40 +0100 Subject: [PATCH 1/2] ci: cache node_modules and Playwright browser binary node_modules and the Playwright Chromium binary were downloaded fresh on every run, making setup account for ~99% of pipeline runtime. - Cache frontend/node_modules keyed on package-lock.json hash - Cache ~/.cache/ms-playwright keyed on package-lock.json hash - On cache hit: skip npm ci and browser download, only reinstall system deps (install-deps) which is much faster than a full install Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/ci.yml | 50 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 6 deletions(-) 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 -- 2.49.1 From 553fa8a4b9a8e54315b3e51a7c0221e2c0c48056 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 17 Mar 2026 22:06:35 +0100 Subject: [PATCH 2/2] ci: cache Maven repository explicitly for both Java jobs The built-in cache: maven in setup-java@v4 does not reliably work on self-hosted act runners. Replace with an explicit actions/cache@v4 on ~/.m2/repository keyed on pom.xml hash. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/ci.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d92cdc82..991ea0b5 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -69,7 +69,13 @@ jobs: with: java-version: '21' distribution: temurin - cache: maven + + - name: Cache Maven repository + uses: actions/cache@v4 + with: + path: ~/.m2/repository + key: maven-${{ hashFiles('backend/pom.xml') }} + restore-keys: maven- - name: Run backend tests run: | @@ -118,7 +124,13 @@ jobs: with: java-version: '21' distribution: temurin - cache: maven + + - name: Cache Maven repository + uses: actions/cache@v4 + with: + path: ~/.m2/repository + key: maven-${{ hashFiles('backend/pom.xml') }} + restore-keys: maven- - name: Build backend (skip tests — covered by separate Java test job) run: | -- 2.49.1