Skip to content

Commit 1d63400

Browse files
authoredJan 27, 2024
chore: add UploadCoverageReport.yml (#1599)
1 parent 0e5cf5e commit 1d63400

File tree

5 files changed

+901
-1467
lines changed

5 files changed

+901
-1467
lines changed
 

Diff for: ‎.github/workflows/UploadCoverageReport.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: UploadCoverageReport
3+
4+
'on':
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- master
9+
pull_request:
10+
11+
jobs:
12+
UploadCoverageReport:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
cache: npm
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Generate coverage report
26+
run: npm test -- --coverage
27+
28+
- name: Upload coverage to codecov
29+
uses: codecov/codecov-action@v3
30+
with:
31+
files: "coverage/coverage-final.json"
32+
fail_ci_if_error: true
33+
...

Diff for: ‎.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ yarn-error.log*
1414

1515
# intelliJ workspace folder
1616
.idea
17+
18+
/coverage

Diff for: ‎package-lock.json

+860-1,465
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: ‎package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"globby": "^13.2.2",
1717
"husky": "^8.0.3",
1818
"prettier": "^3.0.3",
19-
"vitest": "^0.34.6"
19+
"vitest": "^1.2.1",
20+
"@vitest/coverage-v8": "^1.2.1"
2021
},
2122
"engines": {
2223
"node": ">=20.6.0"

Diff for: ‎vitest.config.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { defineConfig } from 'vitest/config'
33
export default defineConfig({
44
test: {
55
globals: true,
6-
restoreMocks: true
6+
restoreMocks: true,
7+
coverage: {
8+
reporter: ['text', 'json', 'html']
9+
}
710
}
811
})

0 commit comments

Comments
 (0)
Please sign in to comment.