From ab43a43e98f02b6dc852e311e4df1766cddd201e Mon Sep 17 00:00:00 2001 From: Mark Chmarny Date: Fri, 18 Sep 2020 09:26:35 -0700 Subject: [PATCH] cover on push (#78) * cover on push * newline * badge * test cover options * exluded examples * exclude cleanup --- .codecov.yaml | 4 ++++ .github/workflows/test-on-push.yaml | 5 ++++- .gitignore | 1 + Makefile | 7 ++++++- Readme.md | 2 +- 5 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 .codecov.yaml diff --git a/.codecov.yaml b/.codecov.yaml new file mode 100644 index 0000000..ae398f7 --- /dev/null +++ b/.codecov.yaml @@ -0,0 +1,4 @@ +ignore: + - "dapr/proto/**" + - "example/**" + diff --git a/.github/workflows/test-on-push.yaml b/.github/workflows/test-on-push.yaml index fa97526..ed9f9b5 100644 --- a/.github/workflows/test-on-push.yaml +++ b/.github/workflows/test-on-push.yaml @@ -36,8 +36,11 @@ jobs: go mod vendor - name: Test - run: go test -v -count=1 -race ./... + run: go test -v -count=1 -race -coverprofile=coverage.txt -covermode=atomic ./... + - name: Cover + uses: codecov/codecov-action@v1 + - name: Lint uses: golangci/golangci-lint-action@v1 with: diff --git a/.gitignore b/.gitignore index a347e7b..d0b9e12 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ vendor # docs golang.org +coverage.txt diff --git a/Makefile b/Makefile index d74a98f..44bacb3 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,12 @@ tidy: ## Updates the go modules go mod tidy test: mod ## Tests the entire project - go test -count=1 -race ./... + go test -v \ + -count=1 \ + -race \ + -coverprofile=coverage.txt \ + -covermode=atomic \ + ./... cover: mod ## Displays test coverage in the client and service packages go test -coverprofile=cover-client.out ./client && go tool cover -html=cover-client.out diff --git a/Readme.md b/Readme.md index dee4a6c..6786768 100644 --- a/Readme.md +++ b/Readme.md @@ -2,7 +2,7 @@ Client library to help you build Dapr application in go. This client supports all public [Dapr APIs](https://github.com/dapr/docs/tree/master/reference/api) while focusing on idiomatic go experience and developer productivity. -[![Test](https://github.com/dapr/go-sdk/workflows/Test/badge.svg)](https://github.com/dapr/go-sdk/actions?query=workflow%3ATest) [![Release](https://github.com/dapr/go-sdk/workflows/Release/badge.svg)](https://github.com/dapr/go-sdk/actions?query=workflow%3ARelease) [![Go Report Card](https://goreportcard.com/badge/github.com/dapr/go-sdk)](https://goreportcard.com/report/github.com/dapr/go-sdk) ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/dapr/go-sdk) +[![Test](https://github.com/dapr/go-sdk/workflows/Test/badge.svg)](https://github.com/dapr/go-sdk/actions?query=workflow%3ATest) [![Release](https://github.com/dapr/go-sdk/workflows/Release/badge.svg)](https://github.com/dapr/go-sdk/actions?query=workflow%3ARelease) [![Go Report Card](https://goreportcard.com/badge/github.com/dapr/go-sdk)](https://goreportcard.com/report/github.com/dapr/go-sdk) ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/dapr/go-sdk) [![codecov](https://codecov.io/gh/dapr/go-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/dapr/go-sdk) ## Usage