Skip to content

Commit

Permalink
Changed Coverage Job to use Golang Image
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
richardcase committed Aug 10, 2018
1 parent 7701fdc commit 1e438e9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
18 changes: 14 additions & 4 deletions .circleci/config.yml
Expand Up @@ -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:
Expand Down
15 changes: 9 additions & 6 deletions Makefile
Expand Up @@ -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
Expand Down

0 comments on commit 1e438e9

Please sign in to comment.