Skip to content

Commit aca8f79

Browse files
authored
ci: Add codecov in unittests (#622)
* ci: Add codecov in unittests Signed-off-by: Xuanwo <[email protected]> * Fix upload Signed-off-by: Xuanwo <[email protected]> * Rename Signed-off-by: Xuanwo <[email protected]> * Increase dropdown rate Signed-off-by: Xuanwo <[email protected]> * Include project status Signed-off-by: Xuanwo <[email protected]> * Fix project rate not updated Signed-off-by: Xuanwo <[email protected]>
1 parent 6b6cdc2 commit aca8f79

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

Diff for: .github/workflows/unit-test.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "Unit Test"
22

3-
on: [push,pull_request]
3+
on: [ push,pull_request ]
44

55
jobs:
66
unit_test:
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
go: [ "1.15", "1.16" ]
13-
os: [ubuntu-latest, windows-latest, macos-latest]
13+
os: [ ubuntu-latest, windows-latest, macos-latest ]
1414

1515
steps:
1616
- name: Set up Go 1.x
@@ -26,3 +26,9 @@ jobs:
2626

2727
- name: Test
2828
run: make test
29+
30+
- uses: codecov/codecov-action@v1
31+
with:
32+
flags: unittests
33+
name: ${{ matrix.go }}-${{ matrix.os }}
34+
files: ./coverage.txt

Diff for: codecov.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1-
ignore:
2-
- "services/**/generated.go"
3-
- "**/error.go"
1+
coverage:
2+
range: "0...100" # For now, we will allow any coverage
3+
status:
4+
project:
5+
default:
6+
target: auto
7+
threshold: 100% # For now, we will allow any rate of test dropdown.
8+
patch:
9+
default:
10+
target: auto
11+
threshold: 100% # For now, we will allow any rate of test dropdown.

0 commit comments

Comments
 (0)