Skip to content

Commit

Permalink
Add basic go test coverage to PRs
Browse files Browse the repository at this point in the history
 - Building on the prior CI changes to lint and produce test artifacts,
   use the action go-coverage-report to examine the cover.out file
   produced to generate a small coverage report
  • Loading branch information
ddl-ebrown committed May 26, 2024
1 parent ae72b03 commit fd6eaa6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,15 @@ jobs:
path: test/*.xml
reporter: java-junit
output-to: 'step-summary'

coverage:
name: code coverage
if: github.event_name == 'pull_request' # Do not run when workflow is triggered by push to main branch
runs-on: ubuntu-latest
needs: test # Depends on the artifact uploaded by the "test" job
steps:
- uses: fgrosse/go-coverage-report@v1.0.1
with:
coverage-artifact-name: "test-results" # can be omitted if you used this default value
coverage-file-name: "cover.out"
continue-on-error: true

0 comments on commit fd6eaa6

Please sign in to comment.