ci: simplify npm cache
Simplify npm cache
This commit is contained in:
parent
951db2aa90
commit
e69f7a6c63
2 changed files with 3 additions and 54 deletions
19
.github/workflows/release.yml
vendored
19
.github/workflows/release.yml
vendored
|
@ -14,30 +14,13 @@ jobs:
|
||||||
uses: actions/setup-node@v3.7.0
|
uses: actions/setup-node@v3.7.0
|
||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version: '20.x'
|
||||||
|
cache: 'npm'
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3.5.3
|
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
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
|
|
38
.github/workflows/test.yml
vendored
38
.github/workflows/test.yml
vendored
|
@ -20,24 +20,7 @@ jobs:
|
||||||
uses: actions/setup-node@v3.7.0
|
uses: actions/setup-node@v3.7.0
|
||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version: '20.x'
|
||||||
|
cache: 'npm'
|
||||||
- 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 NPM dependencies
|
- name: Install NPM dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
@ -56,24 +39,7 @@ jobs:
|
||||||
uses: actions/setup-node@v3.7.0
|
uses: actions/setup-node@v3.7.0
|
||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version: '20.x'
|
||||||
|
cache: 'npm'
|
||||||
- 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 NPM dependencies
|
- name: Install NPM dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
Loading…
Reference in a new issue