File tree Expand file tree Collapse file tree 6 files changed +58
-1
lines changed Expand file tree Collapse file tree 6 files changed +58
-1
lines changed Original file line number Diff line number Diff line change 23
23
24
24
- name : Build
25
25
run : make build
26
+
27
+ - uses : actions/upload-artifact@v2
28
+ with :
29
+ name : coverage.out
30
+ path : coverage.out
31
+
32
+ coverage :
33
+ runs-on : ubuntu-20.04
34
+ needs : [ build ]
35
+ steps :
36
+ - uses : actions/checkout@v3
37
+
38
+ - name : Set up Go
39
+ uses : actions/setup-go@v3
40
+ with :
41
+ go-version : 1.17
42
+
43
+ - name : download coverage.out
44
+ uses : actions/download-artifact@v2
45
+ with :
46
+ name : coverage.out
47
+ path : ./
48
+
49
+ - name : coverage conversion setup
50
+ run :
go install github.com/jandelgado/[email protected]
51
+
52
+ - name : coverage conversion
53
+ run : gcov2lcov -infile=coverage.out -outfile=coverage.lcov
54
+
55
+ - name : code coverage comment
56
+
57
+ with :
58
+ lcov-file : ./coverage.lcov
59
+ github-token : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1
1
# Binaries for programs and plugins
2
2
bin /
3
3
dist /
4
+ coverage.out
Original file line number Diff line number Diff line change 46
46
47
47
.PHONY : test
48
48
test : lint vet
49
- go test ./... ./cmd/...
49
+ go test -coverprofile=coverage.out ./... ./cmd/...
50
50
51
51
.PHONY : build
52
52
build : bin/pvmigrate
Original file line number Diff line number Diff line change @@ -35,12 +35,14 @@ require (
35
35
github.com/pmezard/go-difflib v1.0.0 // indirect
36
36
github.com/spf13/pflag v1.0.5 // indirect
37
37
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
38
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
38
39
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
39
40
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
40
41
golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8 // indirect
41
42
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
42
43
golang.org/x/text v0.3.7 // indirect
43
44
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
45
+ golang.org/x/tools v0.1.5 // indirect
44
46
google.golang.org/appengine v1.6.7 // indirect
45
47
google.golang.org/protobuf v1.27.1 // indirect
46
48
gopkg.in/inf.v0 v0.9.1 // indirect
Original file line number Diff line number Diff line change @@ -522,6 +522,7 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu
522
522
golang.org/x/lint v0.0.0-20200130185559-910be7a94367 /go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY =
523
523
golang.org/x/lint v0.0.0-20200302205851-738671d3881b /go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY =
524
524
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 /go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY =
525
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug =
525
526
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 /go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY =
526
527
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6 /go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE =
527
528
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 /go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o =
@@ -751,6 +752,7 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f
751
752
golang.org/x/tools v0.0.0-20210106214847-113979e3529a /go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA =
752
753
golang.org/x/tools v0.1.0 /go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0 =
753
754
golang.org/x/tools v0.1.2 /go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk =
755
+ golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA =
754
756
golang.org/x/tools v0.1.5 /go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk =
755
757
golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff /go.mod h1:YD9qOF0M9xpSpdWTBbzEl5e/RnCefISl8E5Noe10jFM =
756
758
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 /go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0 =
Original file line number Diff line number Diff line change
1
+ package version
2
+
3
+ import "testing"
4
+
5
+ func TestPrint (t * testing.T ) {
6
+ tests := []struct {
7
+ name string
8
+ }{
9
+ {
10
+ name : "this should not panic" ,
11
+ },
12
+ }
13
+ for _ , tt := range tests {
14
+ t .Run (tt .name , func (t * testing.T ) {
15
+ Print ()
16
+ })
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments