From 673eb4d6c778ce70e4d451d04bac68f418fd6fa9 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Fri, 10 Feb 2023 16:47:22 +0100 Subject: [PATCH] =?UTF-8?q?CI:=20cache=20npm's=20cache=20across=20jobs=20&?= =?UTF-8?q?=20runs=20=F0=9F=92=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b22b61dd..c6ee2c5e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,9 @@ name: test on: [push, pull_request] +env: + npm_config_cache: /tmp/npm-cache + jobs: unit-tests: runs-on: ubuntu-latest @@ -15,6 +18,13 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} + + - id: cache-npm + name: restore npm cache + uses: actions/cache@v3 + with: + key: npm-cache-${{ github.ref_name }} + path: ${{ env.npm_config_cache }} - run: npm install - run: npm run lint @@ -33,6 +43,13 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} + + - id: cache-npm + name: restore npm cache + uses: actions/cache@v3 + with: + key: npm-cache-${{ github.ref_name }} + path: ${{ env.npm_config_cache }} - run: npm install - run: npm run lint @@ -51,6 +68,13 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} + + - id: cache-npm + name: restore npm cache + uses: actions/cache@v3 + with: + key: npm-cache-${{ github.ref_name }} + path: ${{ env.npm_config_cache }} - run: npm install - run: npm run lint