diff --git a/.test-coverage b/.test-coverage index 6293cb27..c6bd28b1 100755 --- a/.test-coverage +++ b/.test-coverage @@ -1,6 +1,12 @@ #!/bin/bash # Issue: https://github.com/mattn/goveralls/issues/20 # Source: https://github.com/uber/go-torch/blob/63da5d33a225c195fea84610e2456d5f722f3963/.test-cover.sh +CI=$1 +echo "run for $CI" + +if [ "$CI" == "circle-ci" ]; then + cd ${GOPATH}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} +fi echo "mode: count" > profile.cov FAIL=0 @@ -20,7 +26,7 @@ done # Failures have incomplete results, so don't send if [ "$FAIL" -eq 0 ]; then - goveralls -service=travis-ci -v -coverprofile=profile.cov + goveralls -service=$CI -v -coverprofile=profile.cov bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -f profile.cov fi diff --git a/.travis.yml b/.travis.yml index e6015865..4b8901bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,5 +7,5 @@ install: - go get github.com/mattn/goveralls - go get golang.org/x/tools/cmd/cover script: - - ./.test-coverage + - ./.test-coverage travis-ci - go install github.com/FreifunkBremen/yanic diff --git a/README.md b/README.md index faad9e72..dd1b3a61 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Yet another node info collector ``` [![Build Status](https://travis-ci.org/FreifunkBremen/yanic.svg?branch=master)](https://travis-ci.org/FreifunkBremen/yanic) +[![CircleCI](https://circleci.com/gh/FreifunkBremen/yanic/tree/master.svg?style=shield)](https://circleci.com/gh/FreifunkBremen/yanic/tree/master) [![Coverage Status](https://coveralls.io/repos/github/FreifunkBremen/yanic/badge.svg?branch=master)](https://coveralls.io/github/FreifunkBremen/yanic?branch=master) [![codecov](https://codecov.io/gh/FreifunkBremen/yanic/branch/master/graph/badge.svg)](https://codecov.io/gh/FreifunkBremen/yanic) [![Go Report Card](https://goreportcard.com/badge/github.com/FreifunkBremen/yanic)](https://goreportcard.com/report/github.com/FreifunkBremen/yanic) diff --git a/circle.yml b/circle.yml new file mode 100644 index 00000000..e0cadc4d --- /dev/null +++ b/circle.yml @@ -0,0 +1,36 @@ +version: 2 +jobs: + build: + docker: + - image: circleci/golang:1.8 + - image: circleci/golang:1.8.1 + - image: circleci/golang:latest + working_directory: /go/src/github.com/FreifunkBremen/yanic + steps: + - checkout + - run: go get -t -d -v ./... + - run: go install github.com/FreifunkBremen/yanic + - store_artifacts: + path: /go/bin/ + destination: yanic + test: + docker: + - image: circleci/golang:1.8 + - image: circleci/golang:1.8.1 + - image: circleci/golang:latest + working_directory: /go/src/github.com/FreifunkBremen/yanic + steps: + - checkout + - run: go get -t -d -v ./... + - run: go get github.com/mattn/goveralls + - run: go get golang.org/x/tools/cmd/cover + - run: ./.test-coverage circle-ci + - store_test_results: + path: ./ + destination: profile.cov +workflows: + version: 2 + build_and_test: + jobs: + - build + - test