From ae00bf1d484db3c136c4171fd4396c3646033033 Mon Sep 17 00:00:00 2001 From: Dan Kogai Date: Wed, 21 Feb 2024 23:15:35 +0900 Subject: [PATCH] fix github actions --- .github/workflows/node.js.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 8816cad..10be49a 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -15,12 +15,20 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [20, 18, 16, 14] + node-version: [20, 18] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm install + - uses: actions/cache@v3 + id: node_modules_cache_id + env: + cache-name: cache-node-modules + with: + path: '**/node_modules' + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + - run: echo '${{ toJSON(steps.node_modules_cache_id.outputs) }}' + - if: ${{ steps.node_modules_cache_id.outputs.cache-hit != 'true' }} + run: npm install - run: npm test