Skip to content

Commit 89a7100

Browse files
ci: fix
1 parent cf7d0cf commit 89a7100

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.github/workflows/nodejs.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,22 +78,25 @@ jobs:
7878
if: matrix.os == 'windows-latest'
7979
run: npm i -g npm
8080

81+
- name: Get npm cache directory
82+
id: npm-cache-dir
83+
run: |
84+
echo "::set-output name=dir::$(npm config get cache)"
85+
8186
- name: Cache Node.js modules
8287
id: cache
8388
uses: actions/cache@v2
8489
with:
85-
# npm cache files are stored in `~/.npm` on Linux/macOS
86-
path: ~/.npm
87-
key: ${{ runner.OS }}-${{ matrix.node-version }}-${{ matrix.webpack-version }}-${{ hashFiles('**/package-lock.json') }}
90+
path: ${{ steps.npm-cache-dir.outputs.dir }}
91+
key: ${{ runner.os }}-${{ matrix.webpack-version }}-node-${{ hashFiles('**/package-lock.json') }}
8892
restore-keys: |
89-
${{ runner.OS }}-${{ matrix.node-version }}-${{ matrix.webpack-version }}-
90-
${{ runner.OS }}-
93+
${{ runner.os }}-${{ matrix.webpack-version }}-node-
9194
9295
- name: Install dependencies
93-
if: steps.cache.outputs.cache-hit != 'true'
9496
run: npm ci
9597

9698
- name: Install webpack ${{ matrix.webpack-version }}
99+
if: matrix.webpack-version == '4'
97100
run: npm i webpack@${{ matrix.webpack-version }}
98101

99102
- name: Link webpack-dev-server

0 commit comments

Comments
 (0)