Skip to content

Commit

Permalink
feat: add codecov.io coverage (#1008)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaneutt authored Jan 20, 2021
1 parent 30a85a7 commit daa9afa
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@ jobs:
run: go get -u golang.org/x/lint/golint
- name: Checkout repository
uses: actions/checkout@v2
- name: Run tests
run: make test
- name: Run tests with Coverage
run: make coverage
- name: Upload Code Coverage
run: "bash <(curl -s https://codecov.io/bash)"
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ _testmain.go
.coverprofile
/gover.coverprofile
e2e-tests

coverage.out
coverage.out.tmp
coverage.txt

# for this repo only
kong-ingress-controller

Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ test-all: lint test
test:
go test -race ./...

.PHONY: coverage
coverage:
go test -race -v -count=1 -coverprofile=coverage.out.tmp ./...
# ignoring generated code for coverage
grep -E -v 'pkg/apis/|pkg/client/|generated.go|generated.deepcopy.go' coverage.out.tmp > coverage.out
rm -f coverage.out.tmp

.PHONY: lint
lint: verify-tidy
golangci-lint run ./...
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![][kong-logo]][kong-url]
[![Build Status](https://github.com/kong/kubernetes-ingress-controller/workflows/Test/badge.svg)](https://github.com/kong/kubernetes-ingress-controller/actions?query=branch%3Amaster+event%3Apush)
[![codecov](https://codecov.io/gh/Kong/kubernetes-ingress-controller/branch/main/graph/badge.svg?token=S1aqcXiGEo)](https://codecov.io/gh/Kong/kubernetes-ingress-controller)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/Kong/kong/blob/master/LICENSE)
[![Twitter](https://img.shields.io/twitter/follow/thekonginc.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=thekonginc)

Expand Down

0 comments on commit daa9afa

Please sign in to comment.