From 14c94a4ff1daac24d6f706d6c29f360fbf8db071 Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Fri, 9 Jan 2015 12:43:48 +0000 Subject: [PATCH] Bring ecc under CI - Add `circle.yml` - Update `Maekfile` - Add `.gitignore` - Add status badges to `README.md` Signed-off-by: Dave Tucker --- .gitignore | 32 ++++++++++++++++++++++++++++++++ Makefile | 5 ++++- README.md | 2 ++ circle.yml | 27 +++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 circle.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a68f52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +### https://raw.github.com/github/gitignore/master/Go.gitignore + +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof + +# Coverage +*.out + +# Test data +data-dir/ diff --git a/Makefile b/Makefile index 2c418c5..02430dc 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,10 @@ -all: build test +all: build test test-all build: go build -v test: + go test -covermode=count -test.short -coverprofile=coverage.out -v + +test-all: go test -covermode=count -coverprofile=coverage.out -v diff --git a/README.md b/README.md index 4e8d5c6..11841c9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ ecc === +[![Circle CI](https://circleci.com/gh/socketplane/ecc.svg?style=svg)](https://circleci.com/gh/socketplane/ecc) [![Coverage Status](https://img.shields.io/coveralls/socketplane/ecc.svg)](https://coveralls.io/r/socketplane/ecc) + Embedded Clustering Client. Currently using Consul. diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..3dae49f --- /dev/null +++ b/circle.yml @@ -0,0 +1,27 @@ +--- +machine: + environment: + DOCKER_IP: "127.0.0.1" + GOPATH: "/home/ubuntu/.go_workspace" + ORG_PATH: "github.com/socketplane" + REPO_PATH: "${ORG_PATH}/ecc" + +dependencies: + override: + - rm -rf ${GOPATH}/src/${REPO_PATH} + - mkdir -p ${GOPATH}/src/${ORG_PATH} + - cp -r ../ecc ${GOPATH}/src/${ORG_PATH} + - mkdir -p ${CIRCLE_ARTIFACTS}/coverage + - go get github.com/mattn/goveralls + +test: + override: + - make build: + pwd: ../.go_workspace/src/${REPO_PATH} + - make test-all: + pwd: ../.go_workspace/src/${REPO_PATH} + post: + - go tool cover -html=coverage.out -o $CIRCLE_ARTIFACTS/coverage/index.html: + pwd: ../.go_workspace/src/${REPO_PATH} + - goveralls -coverprofile=coverage.out -service=circleci -repotoken $COVERALLS_TOKEN: + pwd: ../.go_workspace/src/${REPO_PATH}