-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.63 KB
/
ci_coverage.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Test coverage
on:
workflow_dispatch:
push:
branches:
- main
# Only run when push includes commits with changes to:
paths:
- 'src/**.ts'
- 'test/**.ts'
- 'test/**.pot?'
- 'jest.config.ts'
- 'tsup.config.js'
- 'tsconfig.json'
- 'package.json'
- 'package-lock.json'
release:
types: [published]
jobs:
collect_and_upload:
name: Collect and upload test coverage
if: |
github.event_name != 'push' ||
!startsWith(github.event.head_commit.message, 'Merge pull request #')
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 16.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Run Jest with coverage
run: npm test -- --coverage
# Save coverage report in Coveralls
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./test/coverage/lcov.info
# - name: Codecov
# uses: codecov/codecov-action@v3
# with:
# directory: ./test/coverage/
# # token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
# # files: ./coverage1.xml,./coverage2.xml # optional
# flags: unittests # optional
# # path_to_write_report: ./coverage/codecov_report.txt
# # fail_ci_if_error: true # optional (default = false)
# verbose: true # optional (default = false)