Skip to content

Commit

Permalink
Set up codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
akupila committed May 12, 2018
1 parent eeb8e4d commit 7ddd7f4
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:
git --version
git config --global user.email "test@test.com"
git config --global user.name "Test"
go test ./... -cover
bash scripts/test.sh
bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN
- run:
name: Build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
coverage.txt
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![CircleCI](https://circleci.com/gh/akupila/gitprompt.svg?style=svg)](https://circleci.com/gh/akupila/gitprompt)
[![goreportcard](https://goreportcard.com/badge/github.com/akupila/gitprompt)](https://goreportcard.com/report/github.com/akupila/gitprompt)
[![codecov](https://codecov.io/gh/akupila/gitprompt/branch/master/graphs/badge.svg?branch=master)](https://codecov.io/gh/akupila/gitprompt)

gitprompt is a configurable, fast and zero-dependencies* way of getting the
current git status to be displayed in the `PROMPT`.
Expand Down
15 changes: 15 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
codecov:
branch: master
notify:
require_ci_to_pass: yes
coverage:
precision: 2
round: down
range: 70...100
status:
changes: false
patch: false
project:
default:
target: 90%
comment: false
12 changes: 12 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -e
echo "" > coverage.txt

for d in $(go list ./... | grep -v vendor); do
go test -race -coverprofile=profile.out -covermode=atomic $d
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
done

0 comments on commit 7ddd7f4

Please sign in to comment.