Skip to content

Codecov FAQ section #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,43 @@ Alternativly you can completly remove the usage of GoReleaser if you prefer hand

By default `go test` records code coverage for the package that is currently tested. If you want to get more accurate (cross-package) coverage, then consider using [go-acc](https://github.com/ory/go-acc). [Read more](https://www.ory.sh/golang-go-code-coverage-accurate/).

### How to integratee with [Codecov](codecov)

1. Sing up on [CodeCov](https://codecov.io/) and setup your repository.
1. Additionally consider configuring [Codecov GitHub Application](https://github.com/apps/codecov) for better integration.
1. Add [codecov-action](https://github.com/codecov/codecov-action) to [.github/workflows/build.yml](.github/workflows/build.yml):

```yaml
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
file: ./coverage.out
```

4. Add a badge in [README.md](README.md):

```md
[![codecov](https://codecov.io/gh/your_org/repo_name/branch/master/graph/badge.svg)](https://codecov.io/gh/your_org/repo_name)
```

Codecov integration example:
- [repository](https://github.com/pellared/codecov-integration-example).
- [coverage report](https://codecov.io/gh/pellared/codecov-integration-example/src/master/cmd/seed/main.go),
- [pull request comment](https://github.com/pellared/codecov-integration-example/pull/3#issuecomment-653814033).

Read [Codecov docs](https://docs.codecov.io/docs/quick-start) for further information and troubleshooting.

### How to automate generating git tags for next release version

Auto-tagging can be done e.g. by using GitHub Actions like:
Auto-tagging can be done in many ways e.g. by using GitHub Actions like:

- [Github Tag Bump](https://github.com/marketplace/actions/github-tag-bump),
- [bumpr](https://github.com/marketplace/actions/bumpr-bump-version-when-merging-pull-request-with-specific-labels),
- [Increment Semantic Version](https://github.com/marketplace/actions/increment-semantic-version),
- [Github Tag](https://github.com/marketplace/actions/github-tag).

There are many possibilites how it can be achieved. Creating release tags manually is often the optimal approach. Take notice that this template executes a release workflow each time a git tag with `v` prefix is pushed.
However, creating a release tag manually is often the optimal approach. Take notice that this template executes a release workflow each time a git tag with `v` prefix is pushed.


## Contributing

Expand Down