Skip to content

Commit 1fedbb1

Browse files
committed
Use actions/setup-node@v4 for better npm cache management
1 parent 2948702 commit 1fedbb1

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

.github/workflows/phpunit.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,11 @@ jobs:
4747
steps:
4848
- uses: actions/checkout@v2
4949

50-
- name: Cache node modules
51-
uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
52-
env:
53-
cache-name: cache-node-modules
50+
- name: Install NodeJS
51+
uses: actions/setup-node@v4
5452
with:
55-
# npm cache files are stored in `~/.npm` on Linux/macOS
56-
path: ~/.npm
57-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
58-
restore-keys: |
59-
${{ runner.os }}-build-${{ env.cache-name }}-
60-
${{ runner.os }}-build-
61-
${{ runner.os }}-
62-
63-
- name: Use Node.js 20.x
64-
uses: actions/setup-node@v1
65-
with:
66-
node-version: 20.x
53+
node-version-file: '.nvmrc'
54+
cache: 'npm'
6755

6856
- name: Npm install and build
6957
run: |

0 commit comments

Comments
 (0)