-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (31 loc) · 969 Bytes
/
test.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: test
on: [push, pull_request]
jobs:
test:
name: Run tests and upload coverage reports
strategy:
matrix:
node-version: [20.x, 22.x]
os: [ubuntu-latest, windows-latest]
test-set: [ava]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- name: Generate coverage report with ${{ matrix.test-set }}
run: npm run test-cover:${{ matrix.test-set }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
flags: unit,${{ matrix.test-set }},${{ matrix.os }}
fail_ci_if_error: true
verbose: true