From 9400f5ee7f577b5d0fde3053ed8667872a184a82 Mon Sep 17 00:00:00 2001 From: jantoun-scottlogic Date: Tue, 21 May 2024 14:27:05 +0100 Subject: [PATCH] Cache ~/.npm rather than node_modules --- .github/workflows/pull-request.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 5b832c2d..446e5678 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -12,13 +12,11 @@ jobs: with: node-version: 18 - name: Cache dependencies - id: cache uses: actions/cache@v4 with: - path: node_modules + path: ~/.npm key: node-modules-${{ hashFiles('**/package-lock.json') }} - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' run: npm ci - name: Build app run: npm run build @@ -33,13 +31,11 @@ jobs: with: node-version: 18 - name: Cache dependencies - id: cache uses: actions/cache@v4 with: - path: node_modules + path: ~/.npm key: node-modules-${{ hashFiles('**/package-lock.json') }} - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' run: npm ci - name: Run tests run: npm test