improvements #206
Workflow file for this run
This file contains hidden or 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: coverage | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: {} | |
| jobs: | |
| coverage: | |
| permissions: | |
| contents: read | |
| code-quality: write | |
| pull-requests: read # not sure if this is required | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 | |
| with: | |
| go-version: stable | |
| - name: Calculate coverage | |
| run: | | |
| go test -count=1 -v -covermode=atomic -coverprofile=cover.out -coverpkg=./... ./... | |
| - name: Convert Go coverage profile to cobertuba format | |
| run: | | |
| go install github.com/boumenot/gocover-cobertura@v1.5.0 | |
| gocover-cobertura < cover.out > cover.xml | |
| - name: Upload coverage to GitHub API | |
| uses: actions/upload-code-coverage@abb5995db9e0199b0e2bb9dbd136fce4cb1ec4d3 # v1.3.0 | |
| with: | |
| file: cover.xml | |
| language: Go | |
| label: code-coverage/go-test | |
| # feature only available for team and enterprise accounts | |
| fail-on-error: false |