-
Notifications
You must be signed in to change notification settings - Fork 11
40 lines (33 loc) · 1006 Bytes
/
unittest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: unittest
on:
push:
schedule:
- cron: "0 0 * * *"
jobs:
test:
name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [14, 18]
os: [ubuntu-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
architecture: 'x64'
- name: npm install
run: npm install
- name: npm run test
run: npm run test
- name: npm run test:coverage
if: matrix.node_version == 16 && matrix.os == 'ubuntu-latest'
run: npm run test:coverage
- name: Upload coverage to Codecov
if: matrix.node_version == 16 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v2
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage/lcov.info