Skip to content

Commit 39972fd

Browse files
authored
github: add code coverage with codecov.io (#6676)
1 parent 93dbc05 commit 39972fd

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

.github/codecov.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
coverage:
2+
status:
3+
patch:
4+
default:
5+
target: "80"
6+
project:
7+
default:
8+
target: auto
9+
threshold: 1
10+
ignore:
11+
- "test/"
12+
- "benchmark/"
13+
- "internal/testutils"
14+
- ".*.pb.go"
15+
comment:
16+
layout: "header"

.github/workflows/coverage.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: codecov
2+
on: [push, pull_request]
3+
jobs:
4+
upload:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Install checkout
8+
uses: actions/checkout@v4
9+
10+
- name: Install checkout
11+
uses: actions/setup-go@v4
12+
with:
13+
go-version: "stable"
14+
15+
- name: Run coverage
16+
run: go test -coverprofile=coverage.out -coverpkg=./... ./...
17+
18+
- name: Upload coverage to Codecov
19+
uses: codecov/codecov-action@v3

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![Build Status](https://travis-ci.org/grpc/grpc-go.svg)](https://travis-ci.org/grpc/grpc-go)
44
[![GoDoc](https://pkg.go.dev/badge/google.golang.org/grpc)][API]
55
[![GoReportCard](https://goreportcard.com/badge/grpc/grpc-go)](https://goreportcard.com/report/github.com/grpc/grpc-go)
6+
[![codecov](https://codecov.io/gh/{{REPOSITORY}}/branch/main/graph/badge.svg)](https://codecov.io/gh/{{REPOSITORY}})
67

78
The [Go][] implementation of [gRPC][]: A high performance, open source, general
89
RPC framework that puts mobile and HTTP/2 first. For more information see the

0 commit comments

Comments
 (0)