From 83765d27884e9a0ccf709112243536f7eb25058f Mon Sep 17 00:00:00 2001 From: silenceper Date: Sat, 3 Oct 2020 14:44:47 +0800 Subject: [PATCH 1/5] Update go.yml --- .github/workflows/go.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f832ec6..9e6a445 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -21,5 +21,10 @@ jobs: with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. version: v1.26 + - name: Upload Coverage report to CodeCov + uses: codecov/codecov-action@v1.0.0 + with: + token: ${{secrets.CODECOV_TOKEN}} + file: ./coverage.txt - name: Build run: go build -v . From 718af8a85bc7876fdde26c426ed8a8bc5f482e66 Mon Sep 17 00:00:00 2001 From: silenceper Date: Sat, 3 Oct 2020 14:50:32 +0800 Subject: [PATCH 2/5] add codecov.yaml --- codecov.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 codecov.yaml diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 0000000..657d8f7 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,20 @@ +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: "70...100" + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +comment: + layout: "reach,diff,flags,tree" + behavior: default + require_changes: no From 449e0bdd467bec8997418978520b811a0efa6b2f Mon Sep 17 00:00:00 2001 From: silenceper Date: Sat, 3 Oct 2020 14:54:48 +0800 Subject: [PATCH 3/5] update actions --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9e6a445..ad2fd66 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -22,7 +22,7 @@ jobs: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. version: v1.26 - name: Upload Coverage report to CodeCov - uses: codecov/codecov-action@v1.0.0 + uses: codecov/codecov-action@v1 with: token: ${{secrets.CODECOV_TOKEN}} file: ./coverage.txt From 8480c0f7cee8bf3414f516ecf34c43455f8c3c75 Mon Sep 17 00:00:00 2001 From: silenceper Date: Sat, 3 Oct 2020 14:58:51 +0800 Subject: [PATCH 4/5] update actions --- .github/workflows/go.yml | 2 ++ go.sum | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ad2fd66..c18e03a 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -21,6 +21,8 @@ jobs: with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. version: v1.26 + - name: Test + run: go test -coverprofile=coverage.txt -covermode=atomic -race ./... - name: Upload Coverage report to CodeCov uses: codecov/codecov-action@v1 with: diff --git a/go.sum b/go.sum index 3f76568..43aab5f 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,11 @@ github.com/howeyc/fsnotify v0.9.0 h1:0gtV5JmOKH4A8SsFxG2BczSeXWWPvcMT0euZt5gDAxY= github.com/howeyc/fsnotify v0.9.0/go.mod h1:41HzSPxBGeFRQKEEwgh49TRw/nKBsYZ2cF1OzPjSJsA= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/silenceper/log v0.0.0-20171204144354-e5ac7fa8a76a h1:COf2KvPmardI1M8p2fhHsXlFS2EXSQygbGgcDYBI9Wc= github.com/silenceper/log v0.0.0-20171204144354-e5ac7fa8a76a/go.mod h1:nyN/YUSK3CgJjtNzm6dVTkcou+RYXNMP+XLSlzQu0m0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From d48e23c659a3cdf805bb50265dad57077db6582c Mon Sep 17 00:00:00 2001 From: silenceper Date: Sat, 3 Oct 2020 15:02:39 +0800 Subject: [PATCH 5/5] add badge --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 446723d..8154b74 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # gowatch ![Go](https://github.com/silenceper/gowatch/workflows/Go/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/silenceper/gowatch)](https://goreportcard.com/report/github.com/silenceper/gowatch) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/silenceper/gowatch)](https://pkg.go.dev/github.com/silenceper/gowatch) +[![codecov](https://codecov.io/gh/silenceper/gowatch/branch/master/graph/badge.svg)](https://codecov.io/gh/silenceper/gowatch) [中文文档](./README_ZH_CN.md) @@ -83,8 +85,8 @@ build_pkg: "" # build tags build_tags: "" -# Commands that can be executed before build the app -#prev_build_cmds: +# Commands that can be executed before build the app +#prev_build_cmds: # - swag init # Whether to prohibit automatic operation