-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI for code coverage and update README (#222)
- Create coverage.yml - Add codecov.yml to ignore cmd and logs folders - Update README.md - Add badges to show various CI status. - Add API Reference section and link to godoc. - Add Contributing section.
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 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,34 @@ | ||
# coverage.yml Generate and upload Go code coverage report to Codecov. | ||
# https://github.com/onflow/atree/blob/main/.github/workflows/coverage.yml | ||
# 2021-11-26 Created. | ||
|
||
name: coverage | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 # allow GitHub to use latest v2.x of checkout | ||
with: | ||
fetch-depth: 2 | ||
|
||
- uses: actions/setup-go@v2 # allow GitHub to use latest v2.x of setup-go | ||
with: | ||
go-version: '1.17.x' | ||
|
||
- name: Get dependencies | ||
run: go get -v -t -d ./... | ||
|
||
- name: Build project | ||
run: go build ./... | ||
|
||
- name: Generate coverage report | ||
run: go test -timeout 60m -race -coverprofile=coverage.txt -covermode=atomic | ||
|
||
- name: Upload coverage report to Codecov | ||
uses: codecov/[email protected] # use v2.1.0, we can manually update uploader version if needed | ||
with: | ||
files: ./coverage.txt | ||
fail_ci_if_error: false # we can set this to true after "Could not find a repository" upload error is fixed | ||
verbose: true # optional (default = false) |
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,3 @@ | ||
ignore: | ||
- "cmd/**/*" | ||
- "logs/" |