Skip to content

Commit

Permalink
cleanup Makefile and invoke ci testing via makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
jensneuse committed Apr 7, 2019
1 parent 6880877 commit 5045f99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
5 changes: 2 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ jobs:
- image: circleci/golang:1.12
steps:
- checkout
- run: go test ./...
- run: go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.16.0
- run: golangci-lint run
- run: make bootstrap
- run: make ci
release:
docker:
- image: circleci/golang:1.12
Expand Down
22 changes: 8 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
GOLANG_CI_VERSION = "v1.16.0"
HAS_GOLANG_CI_LINT := $(shell command -v golangci-lint;)

.PHONY: test
test:
go test ./...
Expand All @@ -9,7 +12,7 @@ updateTestFixtures:

.PHONY: lint
lint:
gometalinter --config ./gometalinter.json ./pkg/**
golangci-lint run

.PHONY: format
format:
Expand All @@ -18,9 +21,8 @@ format:
.PHONY: prepare-merge
prepare-merge: format test lint

HAS_GOMETALINTER := $(shell command -v gometalinter;)
HAS_DEP := $(shell command -v dep;)
HAS_GIT := $(shell command -v git;)
.PHONY: ci
ci: test lint

.PHONY: generate
generate: $(GOPATH)/bin/go-enum $(GOPATH)/bin/mockgen $(GOPATH)/bin/stringer
Expand All @@ -40,14 +42,6 @@ $(GOPATH)/bin/stringer:

.PHONY: bootstrap
bootstrap:
ifndef HAS_GIT
$(error You must install git)
endif
ifndef HAS_DEP
go get -u github.com/golang/dep/cmd/dep
endif
ifndef HAS_GOMETALINTER
go get -u github.com/alecthomas/gometalinter
gometalinter --install
ifndef HAS_GOLANG_CI_LINT
go get github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANG_CI_VERSION}
endif
dep ensure

0 comments on commit 5045f99

Please sign in to comment.