Skip to content

Commit

Permalink
Add codecov.io (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-martin committed Mar 16, 2017
1 parent 1255ecd commit 4032edd
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,3 +1,4 @@
.idea
src
*.iml
*.iml
coverage.*
6 changes: 5 additions & 1 deletion .travis.yml
@@ -1,4 +1,5 @@
sudo: true
language: go
services:
- docker

Expand All @@ -12,4 +13,7 @@ before_install:
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin

script: docker-compose run goqu
script: docker-compose run goqu-coverage

after_success:
- bash <(curl -s https://codecov.io/bash)
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -8,7 +8,7 @@
[![GitHub tag](https://img.shields.io/github/tag/doug-martin/goqu.svg?style=flat)](https://github.com/doug-martin/goqu/releases)
[![Build Status](https://travis-ci.org/doug-martin/goqu.svg?branch=master)](https://travis-ci.org/doug-martin/goqu)
[![GoDoc](https://godoc.org/github.com/doug-martin/goqu?status.png)](http://godoc.org/github.com/doug-martin/goqu)
[![Coverage Status](https://coveralls.io/repos/github/C2FO/patio/badge.svg?branch=master)](https://coveralls.io/github/C2FO/patio?branch=master)
[![codecov](https://codecov.io/gh/doug-martin/goqu/branch/master/graph/badge.svg)](https://codecov.io/gh/doug-martin/goqu)
[![Join the chat at https://gitter.im/doug-martin/goqu](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/doug-martin/goqu?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

`goqu` is an expressive SQL builder
Expand Down
13 changes: 13 additions & 0 deletions docker-compose.yml
Expand Up @@ -20,6 +20,19 @@ services:
goqu:
image: "golang:${GO_VERSION}"
command: bash -c "sleep 30 && go test -v -race ./..."
working_dir: /go/src/gopkg.in/doug-martin/goqu.v4
volumes:
- "./:/go/src/gopkg.in/doug-martin/goqu.v4"
environment:
MYSQL_URI: 'root@tcp(mysql:3306)/goqumysql?parseTime=true'
PG_URI: 'postgres://postgres:@postgres:5432/goqupostgres?sslmode=disable'
depends_on:
- postgres
- mysql
goqu-coverage:
image: "golang:${GO_VERSION}"
command: bash -c "sleep 30 && ./go.test.sh"
working_dir: /go/src/gopkg.in/doug-martin/goqu.v4
volumes:
- "./:/go/src/gopkg.in/doug-martin/goqu.v4"
environment:
Expand Down
12 changes: 12 additions & 0 deletions go.test.sh
@@ -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 4032edd

Please sign in to comment.