Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
Add coverage report to the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rbehjati committed Sep 9, 2022
1 parent 004579e commit 7f59a4b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@ jobs:
run: |
"${GITHUB_WORKSPACE}/bin/bazel" test --test_output=streamed //...
# TODO(#113): Find a better, and easier-to-navigate way to report coverage.
# Generate coverage report for ./pkg/... and ./internal/... and upload the report as an html file.
# See `go help testflag` and `go tool cover -help` for more option.
test-coverage:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "=1.18.4"
- name: Run go test
run: |
go test -coverpkg=./... -coverprofile coverage.out ./pkg/... ./internal/...
go tool cover -func=coverage.out
go tool cover -html=coverage.out -o coverage.html
- uses: actions/upload-artifact@v3
with:
name: coverage.html
path: coverage.html

check-license-lines:
runs-on: ubuntu-20.04
steps:
Expand Down

0 comments on commit 7f59a4b

Please sign in to comment.