Skip to content

Commit

Permalink
Publish Go unit test coverage in build (#738)
Browse files Browse the repository at this point in the history
Signed-off-by: Mark S. Lewis <[email protected]>
  • Loading branch information
bestbeforetoday authored Jul 31, 2024
1 parent b879379 commit a4aef4d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
go-version:
- "1.21"
- "1.22"
include:
- go-version: "1.22"
coverage: true
env:
SOFTHSM2_CONF: ${{ github.workspace }}/softhsm2.conf
steps:
Expand All @@ -67,6 +70,11 @@ jobs:
run: make generate
- name: Run unit tests
run: make unit-test-go-pkcs11
- name: Coverage report
if: ${{ matrix.coverage }}
run: |
echo '### Unit test coverage' >> ${GITHUB_STEP_SUMMARY}
go tool cover -func cover.out | tail -1 | sed 's/[^0-9]*/Statement coverage: /' >> ${GITHUB_STEP_SUMMARY}
go_scenario:
needs: verify-versions
Expand Down Expand Up @@ -171,7 +179,7 @@ jobs:
- name: Coverage report
if: ${{ matrix.coverage }}
run: |
echo '### Java unit test coverage' >> ${GITHUB_STEP_SUMMARY}
echo '### Unit test coverage' >> ${GITHUB_STEP_SUMMARY}
${{ github.workspace }}/.github/scripts/jacoco2markdown.sh java/target/site/jacoco/jacoco.csv >> ${GITHUB_STEP_SUMMARY}
java_scenario:
Expand Down

0 comments on commit a4aef4d

Please sign in to comment.