-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add codecov automation * Rename codecov check * Add make test-coverage
- Loading branch information
1 parent
6c757ec
commit 8312a95
Showing
5 changed files
with
93 additions
and
4 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,20 @@ | ||
codecov: | ||
require_ci_to_pass: yes | ||
|
||
ignore: | ||
- "internal/tools/*" | ||
|
||
coverage: | ||
precision: 1 | ||
round: down | ||
range: "70...100" | ||
status: | ||
project: | ||
default: | ||
target: auto | ||
threshold: 0.5% | ||
|
||
comment: | ||
layout: "reach,diff,flags,tree" | ||
behavior: default | ||
require_changes: yes |
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,50 @@ | ||
name: Run CodeCov | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
env: | ||
# Path to where test results will be saved. | ||
TEST_RESULTS: /tmp/test-results | ||
# Default minimum version of Go to support. | ||
DEFAULT_GO_VERSION: 1.15 | ||
jobs: | ||
test-coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2.1.3 | ||
with: | ||
go-version: ${{ env.DEFAULT_GO_VERSION }} | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
- name: Setup Environment | ||
run: | | ||
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | ||
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | ||
- name: Module cache | ||
uses: actions/cache@v2.1.6 | ||
env: | ||
cache-name: go-mod-cache | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }} | ||
- name: Run coverage tests | ||
run: | | ||
make test-coverage | ||
mkdir $TEST_RESULTS | ||
cp coverage.out $TEST_RESULTS | ||
cp coverage.txt $TEST_RESULTS | ||
cp coverage.html $TEST_RESULTS | ||
- name: Upload coverage report | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./coverage.txt | ||
fail_ci_if_error: true | ||
verbose: true | ||
- name: Store coverage test output | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: opentelemetry-log-collection-test-output | ||
path: ${{ env.TEST_RESULTS }} |
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 |
---|---|---|
|
@@ -8,3 +8,6 @@ artifacts/* | |
.vscode/* | ||
gen/ | ||
.idea/* | ||
coverage.out | ||
coverage.out.bak | ||
coverage.txt.bak |
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