-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce90655
commit e304705
Showing
1 changed file
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,9 +67,23 @@ jobs: | |
${{ runner.os }}-go- | ||
- name: Run Unit Tests | ||
run: make test | ||
- name: Publish Unit Test Coverage | ||
uses: codecov/codecov-action@v1 | ||
- name: Archive code coverage results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
flags: unittests | ||
file: cover.out | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
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 |