From a4f0ff70fe6fad14812854cd5aab9222d285e9cd Mon Sep 17 00:00:00 2001 From: Oscar Dominguez Date: Mon, 19 Jul 2021 19:39:55 +0200 Subject: [PATCH] ci(workflow): add 'npm' cache for actions/setup-node in .github/workflows (#2038) --- .github/workflows/release.yml | 4 +++- .github/workflows/test.yml | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6d21c4ce..f211732c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,9 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 - - uses: bahmutov/npm-install@v1 + with: + cache: npm + - run: npm ci - run: npx semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 762718a8..835974c0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,9 +31,10 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} + cache: npm - name: Ensure dependencies are compatible with the version of node run: echo 'engine-strict=true' >> .npmrc - - uses: bahmutov/npm-install@v1 + - run: npm ci - run: npm run test:ci # separate job to set as required in branch protection, @@ -44,5 +45,7 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 - - uses: bahmutov/npm-install@v1 + with: + cache: npm + - run: npm ci - run: npm run lint