Skip to content

Commit

Permalink
FAQ: Codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared authored Jul 5, 2020
1 parent e108ee8 commit d443aaa
Showing 1 changed file with 29 additions and 2 deletions.
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

0 comments on commit d443aaa

Please sign in to comment.