Skip to content

Commit

Permalink
[no-relnote] Add test coverage report
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Lezar <[email protected]>
  • Loading branch information
elezar committed Feb 6, 2025
1 parent b69d98d commit 7ab654e
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/golang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
args: -v --timeout 5m
skip-cache: true
- name: Check golang modules
run: |
run: |
make check-vendor
make -C deployments/devel check-modules
test:
Expand All @@ -67,7 +67,29 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOLANG_VERSION }}
- run: make test
- run: make coverage

- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: coverage.out.no-mocks

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: tests # Depends on the artifact uploaded by the "unit_tests" job
permissions:
contents: read
actions: read # to download code coverage results from "test" job
pull-requests: write # write permission needed to comment on PR
steps:
- uses: fgrosse/[email protected] # Consider using a Git revision for maximum security
with:
coverage-artifact-name: "code-coverage" # can be omitted if you used this default value
coverage-file-name: "coverage.out.no-mocks" # can be omitted if you used this default value

build:
name: Build
runs-on: ubuntu-latest
Expand Down

0 comments on commit 7ab654e

Please sign in to comment.