2021-01-12 11:00:37 +08:00
|
|
|
name: Unit Test
|
2020-07-25 23:38:24 +08:00
|
|
|
|
2020-09-01 13:27:19 +08:00
|
|
|
on: pull_request
|
2020-07-25 23:38:24 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2021-09-08 21:42:17 +08:00
|
|
|
name: Unit Test (${{ matrix.node-name }})
|
2020-07-25 23:38:24 +08:00
|
|
|
runs-on: ubuntu-latest
|
2021-08-28 19:54:19 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-09-27 15:25:58 +08:00
|
|
|
node-version: ['16']
|
2021-09-08 21:42:17 +08:00
|
|
|
include:
|
2021-09-12 19:16:08 +08:00
|
|
|
- node-version: '16'
|
2021-09-08 21:42:17 +08:00
|
|
|
node-name: 'Latest'
|
2020-07-25 23:38:24 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-10-01 14:17:16 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Add dev branch
|
|
|
|
run: git branch dev origin/dev
|
2021-09-23 08:12:37 +08:00
|
|
|
- name: Setup pnpm
|
|
|
|
uses: pnpm/action-setup@v2
|
|
|
|
with:
|
|
|
|
version: 6.15.1
|
2020-08-03 18:07:29 +08:00
|
|
|
- name: Setup node
|
2020-12-31 11:12:52 +08:00
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
2021-08-28 19:54:19 +08:00
|
|
|
node-version: ${{ matrix.node-version }}
|
2021-09-23 08:12:37 +08:00
|
|
|
cache: 'pnpm'
|
2020-08-03 18:07:29 +08:00
|
|
|
- name: Install dependencies
|
2021-09-26 01:29:07 +08:00
|
|
|
run: pnpm i
|
2020-08-04 10:49:49 +08:00
|
|
|
- name: Lint
|
2021-09-23 08:12:37 +08:00
|
|
|
run: pnpm lint
|
2020-08-03 21:18:20 +08:00
|
|
|
- name: Test
|
2021-09-23 08:12:37 +08:00
|
|
|
run: pnpm test
|