diff --git a/.gitea/workflows/run-tests.yaml b/.gitea/workflows/run-tests.yaml index e5af4a6..4e54e60 100644 --- a/.gitea/workflows/run-tests.yaml +++ b/.gitea/workflows/run-tests.yaml @@ -42,11 +42,19 @@ jobs: uses: actions/setup-node@v4 with: node-version: '18' - cache: 'npm' - cache-dependency-path: Development/server/package-lock.json + + # Redirect the npm cache away from /root/.npm (root-owned on this runner) + # to a writable temp directory. Also clears any stale node_modules left + # by a previous run that the root-owned cache could not clean up. + - name: Fix npm cache permissions + run: | + mkdir -p /tmp/npm-cache + rm -rf node_modules || true - name: Install dependencies - run: npm ci --prefer-offline + env: + NPM_CONFIG_CACHE: /tmp/npm-cache + run: npm ci # Write a minimal env file so dotenv does not error on startup. # These tests do not hit the database; DB_* values are placeholders.