Skip to content

Commit f663deb

Browse files
authored
ci: improve cache (#3566)
1 parent 1a2ba36 commit f663deb

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

.github/workflows/nodejs.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
uses: actions/setup-node@v2
3636
with:
3737
node-version: ${{ matrix.node-version }}
38+
cache: "npm"
3839

3940
- name: Use latest NPM
4041
run: sudo npm i -g npm
@@ -69,6 +70,7 @@ jobs:
6970
uses: actions/setup-node@v2
7071
with:
7172
node-version: ${{ matrix.node-version }}
73+
cache: "npm"
7274

7375
- name: Use latest NPM on ubuntu/macos
7476
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
@@ -78,20 +80,6 @@ jobs:
7880
if: matrix.os == 'windows-latest'
7981
run: npm i -g npm
8082

81-
- name: Get npm cache directory
82-
id: npm-cache-dir
83-
run: |
84-
echo "::set-output name=dir::$(npm config get cache)"
85-
86-
- name: Cache Node.js modules
87-
id: cache
88-
uses: actions/cache@v2
89-
with:
90-
path: ${{ steps.npm-cache-dir.outputs.dir }}
91-
key: ${{ runner.os }}-${{ matrix.webpack-version }}-node-${{ hashFiles('**/package-lock.json') }}
92-
restore-keys: |
93-
${{ runner.os }}-${{ matrix.webpack-version }}-node-
94-
9583
- name: Install dependencies
9684
run: npm ci
9785

0 commit comments

Comments
 (0)