From 7d42f7cceb055b6c07ec7db48d9dfa03f6bccb6a Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 22 Jul 2020 16:53:08 +0300 Subject: [PATCH] Tweak CI cache (#2904) Enable cache on Windows and fix cache directory to work on all OS'es --- .github/workflows/ci.yml | 8 ++++++-- .github/workflows/docs.yml | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec8eb102c..f1235147d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,11 +36,15 @@ jobs: with: node-version: ${{ matrix.node }} + - name: Get npm cache directory + id: npm-cache + run: | + echo "::set-output name=dir::$(npm config get cache)" + - name: Set up npm cache uses: actions/cache@v2 - if: ${{ !startsWith(runner.os, 'windows') }} with: - path: ~/.npm + path: ${{ steps.npm-cache.outputs.dir }} key: ${{ runner.os }}-node-v${{ env.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}} restore-keys: | ${{ runner.OS }}-node-v${{ env.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0b4beda06..a82082d3f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -34,10 +34,15 @@ jobs: - name: Disable gem docs run: 'echo "gem: --no-document" > ~/.gemrc' + - name: Get npm cache directory + id: npm-cache + run: | + echo "::set-output name=dir::$(npm config get cache)" + - name: Set up npm cache uses: actions/cache@v2 with: - path: ~/.npm + path: ${{ steps.npm-cache.outputs.dir }} key: ${{ runner.os }}-node-v${{ env.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}} restore-keys: | ${{ runner.OS }}-node-v${{ env.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}