From e69f7a6c6326ff17a9569cd44ca0b078fb0612c4 Mon Sep 17 00:00:00 2001 From: Conicaw Date: Sun, 23 Jul 2023 13:38:58 -0500 Subject: [PATCH] ci: simplify npm cache Simplify npm cache --- .github/workflows/release.yml | 19 +----------------- .github/workflows/test.yml | 38 ++--------------------------------- 2 files changed, 3 insertions(+), 54 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dfebfd7..1dbf6a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,30 +14,13 @@ jobs: uses: actions/setup-node@v3.7.0 with: node-version: '20.x' + cache: 'npm' env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Checkout uses: actions/checkout@v3.5.3 - - name: Cache node modules - id: cache-npm - uses: actions/cache@v3.3.1 - env: - cache-name: cache-node-modules - with: - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} - name: List the state of node modules - continue-on-error: true - run: npm list - - name: Install dependencies run: npm ci diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6549c99..d087a4c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,24 +20,7 @@ jobs: uses: actions/setup-node@v3.7.0 with: node-version: '20.x' - - - name: Cache node modules - id: cache-npm - uses: actions/cache@v3.3.1 - env: - cache-name: cache-node-modules - with: - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} - name: List the state of node modules - continue-on-error: true - run: npm list + cache: 'npm' - name: Install NPM dependencies run: npm ci @@ -56,24 +39,7 @@ jobs: uses: actions/setup-node@v3.7.0 with: node-version: '20.x' - - - name: Cache node modules - id: cache-npm - uses: actions/cache@v3.3.1 - env: - cache-name: cache-node-modules - with: - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} - name: List the state of node modules - continue-on-error: true - run: npm list + cache: 'npm' - name: Install NPM dependencies run: npm ci