diff --git a/.circleci/config.yml b/.circleci/config.yml index 7012243117..e7d7bfd194 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,17 +11,27 @@ jobs: steps: - checkout - run: make release - test: - machine: true + coverage: + docker: + - image: circleci/golang:1.10 + working_directory: /go/src/github.com/weaveworks/eksctl steps: - checkout - - run: make install-goveralls - - run: make coverage + - restore_cache: + keys: + - v1-pkg-cache + - run: make setup-coverage + - run: make test-with-coverage + - save_cache: + key: v1-pkg-cache + paths: + - "/go/pkg" workflows: version: 2 any-commit: jobs: + - coverage - make-eksctl-image: filters: tags: diff --git a/Makefile b/Makefile index b2cf81f09c..47ea994c42 100644 --- a/Makefile +++ b/Makefile @@ -10,14 +10,17 @@ build: .PHONY: test test: - go test -v -covermode=count -coverprofile=coverage.out ./pkg/... ./cmd/... + go test -v ./pkg/... ./cmd/... -.PHONY: coverage -coverage: test - goveralls -coverprofile=coverage.out -service=circle-ci -repotoken $(COVERALLS_TOKEN) +.PHONY: test-with-coverage +test-with-coverage: + go test -v -covermode=count -coverprofile=coverage.out ./pkg/... ./cmd/... + goveralls -coverprofile=coverage.out -service=circle-ci -.PHONY: install-goveralls -install-goveralls: +.PHONY: setup-coverage +setup-coverage: + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure go get github.com/mattn/goveralls .PHONY: update-bindata