Skip to content

Commit d443aaa

Browse files
authored
FAQ: Codecov
1 parent e108ee8 commit d443aaa

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

README.md

+29-2
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,43 @@ Alternativly you can completly remove the usage of GoReleaser if you prefer hand
119119
120120
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/).
121121

122+
### How to integratee with [Codecov](codecov)
123+
124+
1. Sing up on [CodeCov](https://codecov.io/) and setup your repository.
125+
1. Additionally consider configuring [Codecov GitHub Application](https://github.com/apps/codecov) for better integration.
126+
1. Add [codecov-action](https://github.com/codecov/codecov-action) to [.github/workflows/build.yml](.github/workflows/build.yml):
127+
128+
```yaml
129+
- name: Upload coverage to Codecov
130+
uses: codecov/[email protected]
131+
with:
132+
file: ./coverage.out
133+
```
134+
135+
4. Add a badge in [README.md](README.md):
136+
137+
```md
138+
[![codecov](https://codecov.io/gh/your_org/repo_name/branch/master/graph/badge.svg)](https://codecov.io/gh/your_org/repo_name)
139+
```
140+
141+
Codecov integration example:
142+
- [repository](https://github.com/pellared/codecov-integration-example).
143+
- [coverage report](https://codecov.io/gh/pellared/codecov-integration-example/src/master/cmd/seed/main.go),
144+
- [pull request comment](https://github.com/pellared/codecov-integration-example/pull/3#issuecomment-653814033).
145+
146+
Read [Codecov docs](https://docs.codecov.io/docs/quick-start) for further information and troubleshooting.
147+
122148
### How to automate generating git tags for next release version
123149

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

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

131-
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.
157+
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.
158+
132159

133160
## Contributing
134161

0 commit comments

Comments
 (0)