Skip to content

Commit f94aa1b

Browse files
committed
Add codecov
Signed-off-by: Wenqi Qiu <[email protected]> Add test file Signed-off-by: Wenqi Qiu <[email protected]>
1 parent 02150d8 commit f94aa1b

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

.github/workflows/go.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ jobs:
1717
go-version: 1.15
1818
- name: Check-out code
1919
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 2
2022
- name: Run unit tests
2123
run: |
2224
make test
25+
- name: Upload coverage to Codecov
26+
uses: codecov/codecov-action@v3
2327

2428
tidy:
2529
runs-on: [ubuntu-latest]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ all: test
44

55
.PHONY: test
66
test:
7-
$(GO) test -v ./...
7+
$(GO) test -v -coverprofile coverage.txt -covermode=atomic -coverpkg=antrea.io/libOpenflow/common/...,antrea.io/libOpenflow/openflow13/...,antrea.io/libOpenflow/openflow15/...,antrea.io/libOpenflow/protocol/...,antrea.io/libOpenflow/util/... antrea.io/libOpenflow/...
88

99
# code linting
1010
.golangci-bin:

codecov.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
codecov:
2+
branch: main
3+
require_ci_to_pass: no
4+
5+
comment:
6+
layout: "reach,diff,flags,tree"
7+
behavior: default
8+
require_changes: no
9+
require_base: no
10+
require_head: no
11+
after_n_builds: 1
12+
show_carryforward_flags: true
13+
14+
github_checks:
15+
annotations: true
16+
17+
coverage:
18+
status:
19+
patch:
20+
default:
21+
target: 70%
22+
threshold: 5%
23+
base: auto
24+
only_pulls: false
25+
project:
26+
default:
27+
target: auto
28+
threshold: 0.3%
29+
30+
flag_management:
31+
default_rules:
32+
carryforward: true
33+
34+
ignore:
35+
- "**/testing/*.go"

0 commit comments

Comments
 (0)