Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add unit test code coverage #627

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .github/workflows/lint-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches: [ "main" ]
paths:
- '.github/workflows/**'
- 'pkg/**'
- 'cmd/**'
- 'api/**'
Expand All @@ -13,6 +14,7 @@ on:
pull_request:
branches: [ "main" ]
paths:
- '.github/workflows/**'
- 'pkg/**'
- 'cmd/**'
- 'api/**'
Expand Down Expand Up @@ -64,4 +66,24 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Run Unit Tests
run: make test
run: make test
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: cover.out # Make sure to use the same file name you chose for the "-coverprofile" in the "Test" step

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 # 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: "cover.out" # can be omitted if you used this default value
Loading