From 46ac6f2211bb4ebe2ed35d638fcabee8d594a7bb Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sat, 2 Nov 2019 22:09:42 +0530 Subject: [PATCH] Cache node_modules in workflows --- .github/workflows/darwin.yml | 10 ++++++++++ .github/workflows/ubuntu.yml | 10 ++++++++++ .github/workflows/windows.yml | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/.github/workflows/darwin.yml b/.github/workflows/darwin.yml index b7ed2f32..40f161f4 100644 --- a/.github/workflows/darwin.yml +++ b/.github/workflows/darwin.yml @@ -21,7 +21,17 @@ jobs: with: node-version: 12.x + - name: Cache node modules + uses: actions/cache@preview + id: cache + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Installing NPM packages + if: steps.cache.outputs.cache-hit != 'true' run: npm install - name: Run tests diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 5c4f5893..5d78e39f 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -21,7 +21,17 @@ jobs: with: node-version: 12.x + - name: Cache node modules + uses: actions/cache@preview + id: cache + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Installing NPM packages + if: steps.cache.outputs.cache-hit != 'true' run: npm install - name: Run tests diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 0716f097..aacac4f8 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -21,7 +21,17 @@ jobs: with: node-version: 12.x + - name: Cache node modules + uses: actions/cache@preview + id: cache + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**\package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Installing NPM packages + if: steps.cache.outputs.cache-hit != 'true' run: npm install - name: Run tests