Skip to content

Commit

Permalink
chore(gha): cache in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Apr 9, 2022
1 parent aae5425 commit eeca141
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/mocha.yml
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- '**'
- '!mochajs.org'
tags-ignore:
- '**'
pull_request:
Expand Down Expand Up @@ -86,10 +87,15 @@ jobs:
with:
node-version: '${{ matrix.node }}'
- uses: actions/checkout@v2
- name: Get npm cache directory in Windows
id: npm-cache
if: "${{ matrix.os == 'windows-2019' }}"
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: 'Cache node_modules'
uses: actions/cache@v2
with:
path: '~/.npm'
path: ${{ matrix.os == 'ubuntu-latest' && '~/.npm' || steps.npm-cache.outputs.dir }}
key: "${{ matrix.os }}-node-v${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
${{ matrix.os }}-node-v${{ matrix.node }}-
Expand Down

0 comments on commit eeca141

Please sign in to comment.