From eeca1418035383e5f1a0a14ffc4f449bcb39b127 Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Sat, 9 Apr 2022 15:42:37 +0200 Subject: [PATCH] chore(gha): cache in Windows --- .github/workflows/mocha.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mocha.yml b/.github/workflows/mocha.yml index 1f20103c50..b30d6016ac 100644 --- a/.github/workflows/mocha.yml +++ b/.github/workflows/mocha.yml @@ -3,6 +3,7 @@ on: push: branches: - '**' + - '!mochajs.org' tags-ignore: - '**' pull_request: @@ -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 }}-