From b5f183cc09e6cbafeddd8e1123cfca718c72d8ca Mon Sep 17 00:00:00 2001 From: Richard Case Date: Sun, 12 Aug 2018 18:05:04 +0100 Subject: [PATCH] Changed Coverage Job to use Golang Image (#160) The coverage job has been changed to use the official CircleCI image and also the makefile has been updated so that all dependencies to run coverage are setup. Also added caching of dependencies. --- .circleci/config.yml | 18 ++++++++++++++---- Makefile | 15 +++++++++------ 2 files changed, 23 insertions(+), 10 deletions(-) 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