Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 53fc8a5

Browse files
committed
Add build/coverage badge. Update travis config to have code coverage.
1 parent 554df08 commit 53fc8a5

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

.travis.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
language: go
2+
sudo: false
23
go:
3-
- 1.x
4+
- 1.x
5+
6+
before_install:
7+
- go get -t -v ./...
8+
9+
script:
10+
- ./test.sh
11+
12+
after_success:
13+
- bash <(curl -s https://codecov.io/bash)

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[![Build
2+
Status](https://travis-ci.org/google/easypki.svg?branch=master)](https://travis-ci.org/google/easypki)
3+
[![codecov](https://codecov.io/gh/google/easypki/branch/master/graph/badge.svg)](https://codecov.io/gh/google/easypki)
4+
15
easypki
26
======
37

test.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
echo "" > coverage.txt
5+
6+
for d in $(go list ./... | grep -v vendor); do
7+
go test -race -coverprofile=profile.out -covermode=atomic $d
8+
if [ -f profile.out ]; then
9+
cat profile.out >> coverage.txt
10+
rm profile.out
11+
fi
12+
done

0 commit comments

Comments
 (0)