forked from akash-network/provider
-
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.
tests: enable codecov (akash-network#21)
fixes ovrclk/engineering#350 Signed-off-by: Artur Troian <[email protected]>
- Loading branch information
Showing
9 changed files
with
83 additions
and
12 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,25 @@ | ||
comment: false | ||
codecov: | ||
require_ci_to_pass: true | ||
branch: main | ||
|
||
coverage: | ||
precision: 2 | ||
round: down | ||
range: 50...100 | ||
|
||
status: | ||
# Learn more at https://docs.codecov.io/docs/commit-status | ||
project: | ||
default: | ||
threshold: 1% # allow this much decrease on project | ||
changes: false | ||
|
||
ignore: | ||
- "**/*mock/.*" | ||
- "pkg/client" | ||
- "**/zz_generated.deepcopy.go" | ||
- "_docs" | ||
- "_run" | ||
- "script" | ||
- "make" |
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
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,26 @@ | ||
name: codecov | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest: | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: c-py/action-dotenv-to-setenv@v3 | ||
with: | ||
env-file: .env | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: "${{ env.GOLANG_VERSION }}" | ||
- run: make modvendor | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: .cache/tests/coverage.txt |
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
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
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
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
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,18 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
OUTDIR=$1 | ||
TAGS=$2 | ||
|
||
coverage="$OUTDIR/coverage.txt" | ||
profile="$OUTDIR/profile.out" | ||
|
||
set -e | ||
echo "mode: atomic" > "$coverage" | ||
while IFS=$'\n' read -r pkg; do | ||
go test -timeout 30m -race -coverprofile="$profile" -covermode=atomic -tags="$TAGS" "$pkg" | ||
if [ -f "$profile" ]; then | ||
tail -n +2 "$profile" >> "$coverage"; | ||
rm "$profile" | ||
fi | ||
done < <(go list ./... | grep -v 'mock\|pkg/client') |
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