From f2e622a10a13b232aa6da1b5ae40032fea071549 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 20 Aug 2020 18:26:23 +0200 Subject: [PATCH] cache node modules in CI --- .github/workflows/nodejs.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index d4cae50a1..29ea138cf 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -23,7 +23,19 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - run: npm install + - name: Use cached node_modules + id: cache + uses: actions/cache@v1 + with: + path: node_modules + key: nodeModules-${{ hashFiles('**/yarn.lock') }}-${{ matrix.node-version }} + restore-keys: | + nodeModules- + - name: Install dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: npm install + env: + CI: true - run: npm run prepare - run: npm test env: