2020-02-09 13:21:39 +08:00
|
|
|
name: build-test
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2020-07-22 20:04:56 +08:00
|
|
|
- main
|
2020-02-09 13:21:39 +08:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
2019-07-12 04:16:54 +08:00
|
|
|
jobs:
|
|
|
|
run:
|
|
|
|
name: Run
|
|
|
|
runs-on: ${{ matrix.operating-system }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
operating-system: [ubuntu-latest, windows-latest]
|
2019-07-26 10:59:14 +08:00
|
|
|
steps:
|
2021-11-08 18:28:08 +08:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2019-07-24 01:24:08 +08:00
|
|
|
|
2022-02-22 23:25:23 +08:00
|
|
|
- name: Setup node 16
|
2021-12-21 00:24:01 +08:00
|
|
|
uses: actions/setup-node@v2
|
2021-11-08 18:28:08 +08:00
|
|
|
with:
|
2022-02-22 23:25:23 +08:00
|
|
|
node-version: 16
|
2021-12-21 00:24:01 +08:00
|
|
|
cache: npm
|
2019-07-12 04:16:54 +08:00
|
|
|
|
2022-02-09 19:59:04 +08:00
|
|
|
- name: npm ci
|
|
|
|
run: npm ci
|
2019-07-12 04:16:54 +08:00
|
|
|
|
2021-11-08 18:28:08 +08:00
|
|
|
- name: Lint
|
|
|
|
run: npm run format-check
|
2019-07-12 04:16:54 +08:00
|
|
|
|
2021-11-08 18:28:08 +08:00
|
|
|
- name: npm test
|
|
|
|
run: npm test
|
2020-02-10 03:41:37 +08:00
|
|
|
|
2021-11-08 18:28:08 +08:00
|
|
|
- name: audit packages
|
|
|
|
run: npm audit --audit-level=high
|
|
|
|
if: matrix.operating-system == 'ubuntu-latest'
|