From d2bc5157bc64c24d87e84715882b9651fd7a4be5 Mon Sep 17 00:00:00 2001 From: Christopher Maier Date: Sun, 12 Mar 2017 11:08:04 -0400 Subject: [PATCH] Add Coveralls integration --- .travis.yml | 2 +- Dockerfile.ci | 5 +++++ Makefile | 5 +++++ README.md | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3736ecc..37f702a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ before_install: # Parallelize these tasks env: - TARGET=vet - - TARGET=test #ci-coveralls + - TARGET=ci-coveralls # Need the job ID in order to upload the Coveralls data script: diff --git a/Dockerfile.ci b/Dockerfile.ci index 43c0c26..34ecd3a 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -1,4 +1,9 @@ FROM operable/go:1.6.3 +# TODO: Consider adding goveralls to base image +ENV PATH=${GOPATH}/bin:${PATH} +# Add goveralls for sending stats to coveralls.io in Travis CI +RUN go get github.com/mattn/goveralls + COPY . $GOPATH/src/github.com/operable/go-relay WORKDIR $GOPATH/src/github.com/operable/go-relay diff --git a/Makefile b/Makefile index b4ad0e6..248d1a4 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,11 @@ test: tools deps lint @rm -rf relay_*_amd64 @go test -v -cover $(FULL_PKGS) +# This is only intended to run in Travis CI and requires goveralls to +# be installed. +ci-coveralls: tools deps + goveralls -service=travis-ci + clean: rm -rf $(BUILD_DIR) relay-test find . -name "*.test" -type f | xargs rm -fv diff --git a/README.md b/README.md index 673c89b..648a711 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Relay [![Build Status](https://travis-ci.org/operable/go-relay.svg?branch=master)](https://travis-ci.org/operable/go-relay) +[![Coverage Status](https://coveralls.io/repos/github/operable/go-relay/badge.svg?branch=master)](https://coveralls.io/github/operable/go-relay?branch=master) ## Dependencies