Skip to content

Commit 3a978bd

Browse files
committed
Add codecov setup
1 parent 307683e commit 3a978bd

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

‎.github/workflows/test.yml‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,15 @@ jobs:
3737
- name: Lint
3838
run: golint ./...
3939
- name: Test
40-
run: go test -race ./...
40+
run: go test -race ./... -coverpkg=./... -coverprofile=coverage.txt -covermode=atomic
41+
- name: Upload coverage
42+
if: success() && matrix.platform == 'ubuntu-latest'
43+
run: |
44+
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step
45+
curl -Os https://uploader.codecov.io/latest/linux/codecov
46+
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
47+
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
48+
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
49+
shasum -a 256 -c codecov.SHA256SUM
50+
chmod +x codecov
51+
./codecov

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[![Tests on Linux, MacOS and Windows](https://github.com/bep/simplecobra/workflows/Test/badge.svg)](https://github.com/bep/simplecobra/actions?query=workflow:Test)
22
[![Go Report Card](https://goreportcard.com/badge/github.com/bep/simplecobra)](https://goreportcard.com/report/github.com/bep/simplecobra)
3+
[![codecov](https://codecov.io/gh/bep/simplecobra/branch/master/graph/badge.svg)](https://codecov.io/gh/bep/simplecobra)
34
[![GoDoc](https://godoc.org/github.com/bep/simplecobra?status.svg)](https://godoc.org/github.com/bep/simplecobra)
45

56
So, [Cobra](https://github.com/spf13/cobra) is a Go CLI library with a feature set that's hard to resist for bigger applications (autocomplete, docs auto generation etc.). But it's also rather complex to use beyond the simplest of applications. This package is built to aid rewriting [Hugo's](https://github.com/gohugoio/hugo) commands package to something that's easier to understand and maintain.

‎codecov.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: auto
6+
threshold: 0.5%
7+
patch: off
8+
9+
comment:
10+
require_changes: true

0 commit comments

Comments
 (0)