File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 2626 - name : Test
2727 run : make test
2828
29+ - name : Archive code coverage results
30+ uses : actions/upload-artifact@v4
31+ with :
32+ name : code-coverage
33+ path : coverage.out
34+
2935 config :
3036 name : Check GoReleaser config
3137 runs-on : ubuntu-latest
3642 - name : Check GoReleaser
3743 uses : goreleaser/goreleaser-action@v6
3844 with :
39- args : check
45+ args : check
46+
47+ code_coverage :
48+ name : " Code coverage report"
49+ if : github.event_name == 'pull_request' # Do not run when workflow is triggered by push to main branch
50+ runs-on : ubuntu-latest
51+ needs : main
52+ permissions :
53+ contents : read
54+ actions : read # to download code coverage results from "test" job
55+ pull-requests : write # write permission needed to comment on PR
56+ steps :
57+ - uses : fgrosse/go-coverage-report@v1.1.1
58+ with :
59+ coverage-file-name : " coverage.out"
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ lint: lint-golangci-lint lint-yamllint
2525# Test
2626test :
2727 @echo " >> Running tests for the CLI application"
28- @go test ./... -count=1
28+ @go test ./... -count=1 -coverprofile=coverage.out
2929
3030# Test coverage
3131coverage :
You can’t perform that action at this time.
0 commit comments