chore: add test coverage report (#25891)

This commit is contained in:
Blaž Dular 2025-12-17 16:24:43 +01:00 • committed by GitHub
parent aaffd29e4c
commit 98c096450e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 1 deletions

View file

@ -117,6 +117,13 @@ jobs:
- name: Test
run: mkdir dist && touch dist/empty && make test
- uses: actions/upload-artifact@v5
if: ${{ !cancelled() }}
with:
name: code-coverage-${{ github.sha }}
path: coverage.out
retention-days: 14
lint:
name: Lint
runs-on: depot-ubuntu-24.04-arm
@ -272,3 +279,25 @@ jobs:
name: playwright-report
path: playwright-report/
retention-days: 14
code_coverage:
name: "Code coverage report"
if: github.event_name == 'pull_request' # Do not run when workflow is triggered by push to main branch
runs-on: ubuntu-latest
needs: [ test ]
continue-on-error: true # not critical
permissions:
contents: read
actions: read
pull-requests: write # write permission needed to comment on PR
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: fgrosse/go-coverage-report@v1.1.1
with:
coverage-artifact-name: code-coverage-${{ github.sha }}
coverage-file-name: coverage.out

View file

@ -80,7 +80,7 @@ test-ui::
test::
@echo "Running testsuite"
CGO_ENABLED=0 go test $(BUILD_TAGS) ./...
CGO_ENABLED=0 go test $(BUILD_TAGS) -coverprofile=coverage.out -covermode=atomic ./...
porcelain::
gofmt -w -l $$(find . -name '*.go')