From 1ceea998679191a3e85a74039b3cb73103c12925 Mon Sep 17 00:00:00 2001 From: Chad Robinson Date: Wed, 8 May 2019 17:46:14 -0700 Subject: [PATCH] Add coverage report from coveralls.io --- .circleci/config.yml | 12 +++++++++++- README.md | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7412f32..d35e3fe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,9 +5,19 @@ jobs: - image: circleci/golang:latest working_directory: /go/src/github.com/c-robinson/iplib + environment: + TEST_RESULTS: /tmp/test-results + steps: - checkout + - run: mkdir -p $TEST_RESULTS + - run: go get github.com/mattn/goveralls - run: name: Run unit tests command: | - go test -v ./... + go test -v -cover -race -coverprofile=${TEST_RESULTS}/coverage.out ./... + - run: + name: Upload coverage results + command: | + goveralls -coverprofile=${TEST_RESULTS}/coverage.out -service=circle-ci -repotoken=$COVERALLS_TOKEN + diff --git a/README.md b/README.md index 299ab62..7957634 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ addresses. Tools include: [![Documentation](https://godoc.org/github.com/c-robinson/iplib?status.svg)](http://godoc.org/github.com/c-robinson/iplib) [![CircleCI](https://circleci.com/gh/c-robinson/iplib/tree/master.svg?style=svg)](https://circleci.com/gh/c-robinson/iplib/tree/master) [![Go Report Card](https://goreportcard.com/badge/github.com/c-robinson/iplib)](https://goreportcard.com/report/github.com/c-robinson/iplib) +[![Coverage Status](https://coveralls.io/repos/github/c-robinson/iplib/badge.svg?branch=master)](https://coveralls.io/github/c-robinson/iplib?branch=master) ##### net.IP tools