forked from sourcenetwork/defradb
-
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.
ci: Add Code Test Coverage with CodeCov (sourcenetwork#116)
Generates defra's code's testing coverage report and uploads it to CodeCov.
- Loading branch information
1 parent
cee48ce
commit df2a81c
Showing
2 changed files
with
36 additions
and
1 deletion.
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,33 @@ | ||
name: Code Test Coverage | ||
|
||
on: [push] | ||
|
||
jobs: | ||
code-test-coverage: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.17' | ||
|
||
- name: Generate coverage report | ||
run: go test ./... -race -coverprofile=coverage.out -covermode=atomic | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
fail_ci_if_error: true | ||
files: ./coverage.out | ||
flags: unittests | ||
name: codecov-umbrella | ||
verbose: true | ||
# path_to_write_report: ./coverage/codecov_report.txt | ||
# directory: ./coverage/reports/ |
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