1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-16 23:58:59 +09:00

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

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