Adding code coverage reporting badge #819
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.23.0" | |
- name: Verify go version | |
run: go version | |
- name: Install GoTest | |
run: go install gotest.tools/gotestsum@latest | |
- name: Test | |
env: | |
ENTERPRISE_LICENSE: ${{ secrets.ENTERPRISE_LICENSE }} | |
run: | | |
gotestsum --junitfile report.xml --format testname -- -coverprofile=cover.out -covermode=atomic -coverpkg=github.com/esnet/gdg/cli/...,github.com/esnet/gdg/cmd/...,github.com/esnet/gdg/internal/...,github.com/esnet/gdg/pkg/... ./... | |
cp cover.out cover.tmp && cat cover.tmp | grep -v "mocks" > cover.out | |
- uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true # optional (default = false) | |
files: cover.out | |
token: ${{ secrets.CODECOV_TOKEN }} | |