ci: use npm ci to improve CI performance

This commit is contained in:
syuilo 2021-07-30 12:56:31 +09:00
parent 51ca78d496
commit 2ffff0fa61
2 changed files with 49 additions and 25 deletions

View File

@ -10,11 +10,21 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Install
run: npm i
node-version: 16.5.0
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint

View File

@ -16,21 +16,35 @@ jobs:
strategy:
matrix:
node-version: [16.x]
node-version: [16.5.0]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm i
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm run test
run: npm test
env:
CI: true
- name: Upload Coverage
uses: codecov/codecov-action@v1