forked from devfile/alizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test coverage check to CI.yaml (#13)
* Add test coverage workflow Signed-off-by: thepetk <[email protected]> * Update ci.yaml Signed-off-by: thepetk <[email protected]> * Add separate check for code coverage Signed-off-by: thepetk <[email protected]> * Move code report in ci file Signed-off-by: thepetk <[email protected]> * Add .codecov.yaml Signed-off-by: thepetk <[email protected]> * Update workflow Signed-off-by: thepetk <[email protected]> * Bump up setup-go Signed-off-by:thepetk <[email protected]> --------- Signed-off-by: thepetk <[email protected]>
- Loading branch information
Showing
3 changed files
with
54 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# See http://docs.codecov.io/docs/coverage-configuration | ||
coverage: | ||
precision: 2 # 2 = xx.xx%, 0 = xx% | ||
round: down | ||
# For example: 20...60 would result in any coverage less than 20% | ||
# would have a red background. The color would gradually change to | ||
# green approaching 60%. Any coverage over 60% would result in a | ||
# solid green color. | ||
range: "60...80" | ||
|
||
status: | ||
# project will give us the diff in the total code coverage between a commit | ||
# and its parent | ||
project: yes | ||
# Patch gives just the coverage of the patch | ||
patch: yes | ||
# changes tells us if there are unexpected code coverage changes in other files | ||
# which were not changed by the diff | ||
changes: yes | ||
|
||
# See http://docs.codecov.io/docs/ignoring-paths | ||
ignore: | ||
- "docs/*" | ||
- ".github/*" | ||
- "resources/*" | ||
- "test/*" | ||
- "Makefile" | ||
|
||
# See http://docs.codecov.io/docs/pull-request-comments-1 | ||
comment: | ||
layout: "diff, files" | ||
behavior: "" | ||
# default = posts once then update, posts new if delete | ||
# once = post once then updates | ||
# new = delete old, post new | ||
# spammy = post new |
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 |
---|---|---|
|
@@ -46,4 +46,20 @@ jobs: | |
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
# Path to SARIF file relative to the root of the repository | ||
sarif_file: gosec.sarif | ||
sarif_file: gosec.sarif | ||
|
||
code-coverage-report: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
persist-credentials: false | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
- name: Run tests | ||
run: make test | ||
- name: Codecov | ||
uses: codecov/[email protected] |
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 |
---|---|---|
|
@@ -16,4 +16,4 @@ buildWin: | |
|
||
.PHONY: test | ||
test: | ||
go test ./... | ||
go test -coverprofile cover.out -v ./... |