diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 000000000000..3743a188decd --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,16 @@ +coverage: + status: + patch: + default: + target: "80" + project: + default: + target: auto + threshold: 1 +ignore: + - "test/" + - "benchmark/" + - "internal/testutils" + - ".*.pb.go" +comment: + layout: "header" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000000..b256bb80de89 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,19 @@ +name: codecov +on: [push, pull_request] +jobs: + upload: + runs-on: ubuntu-latest + steps: + - name: Install checkout + uses: actions/checkout@v4 + + - name: Install checkout + uses: actions/setup-go@v4 + with: + go-version: "stable" + + - name: Run coverage + run: go test -coverprofile=coverage.out -coverpkg=./... ./... + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 diff --git a/README.md b/README.md index 1bc92248cb47..c4d0f02e9245 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Build Status](https://travis-ci.org/grpc/grpc-go.svg)](https://travis-ci.org/grpc/grpc-go) [![GoDoc](https://pkg.go.dev/badge/google.golang.org/grpc)][API] [![GoReportCard](https://goreportcard.com/badge/grpc/grpc-go)](https://goreportcard.com/report/github.com/grpc/grpc-go) +[![codecov](https://codecov.io/gh/{{REPOSITORY}}/branch/main/graph/badge.svg)](https://codecov.io/gh/{{REPOSITORY}}) The [Go][] implementation of [gRPC][]: A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. For more information see the