Skip to content

Adding code coverage reporting badge #819

Adding code coverage reporting badge

Adding code coverage reporting badge #819

Workflow file for this run

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 }}