From 54696e75ca45158f04f3e9b88280aa7152d58148 Mon Sep 17 00:00:00 2001 From: Patrick O'brien Date: Mon, 8 Aug 2016 18:15:16 +1000 Subject: [PATCH] Add goveralls to circleCI and coveralls badge --- README.md | 1 + circle.yml | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 1c97897..0b76da8 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![GoDoc](https://godoc.org/github.com/pobri19/sqlboiler?status.svg)](https://godoc.org/github.com/pobri19/sqlboiler) [![CircleCI](https://circleci.com/gh/nullbio/sqlboiler.svg?style=shield)](https://circleci.com/gh/nullbio/sqlboiler) [![Go Report Card](https://goreportcard.com/badge/kubernetes/helm)](http://goreportcard.com/report/nullbio/sqlboiler) +[![Coverage Status](http://coveralls.io/repos/nullbio/sqlboiler/badge.png?branch=master)](http://coveralls.io/r/nullbio/sqlboiler?branch=master) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nullbio/sqlboiler/blob/master/LICENSE.md) SQLBoiler is a tool to generate a Go ORM tailored to your database schema. diff --git a/circle.yml b/circle.yml index 4a6a0ca..3bdf7fa 100644 --- a/circle.yml +++ b/circle.yml @@ -1,11 +1,20 @@ test: pre: - go get github.com/jstemmer/go-junit-report + - go get github.com/mattn/goveralls - echo -e "[postgres]\nhost=\"localhost\"\nport=5432\nuser=\"ubuntu\"\ndbname=\"sqlboiler\"" > sqlboiler.toml - createdb -U ubuntu sqlboiler - psql -U ubuntu sqlboiler < ./testdata/test_schema.sql - ./sqlboiler postgres override: - go test -v -race ./... > $CIRCLE_ARTIFACTS/gotest.txt + - > + echo "mode: set" > $CIRCLE_ARTIFACTS/coverage.txt && + for i in $(go list ./...); do + rm -f coverage.tmp; + go test -v -coverprofile coverage.tmp $i; + tail -n +2 coverage.tmp >> $CIRCLE_ARTIFACTS/coverage.txt; + done post: - cat $CIRCLE_ARTIFACTS/gotest.txt | go-junit-report > $CIRCLE_TEST_REPORTS/junit.xml + - goveralls -coverprofile=$CIRCLE_ARTIFACTS/coverage.txt -service=circle-ci -repotoken=$COVERALLS_TOKEN