Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move all build logic and dependencies installs to Makefile #155

Merged
merged 1 commit into from
Dec 29, 2016

Conversation

adamdubiel
Copy link
Collaborator

travis.ci configuration uses make commands to be able to replicate CI builds
on local machine

@@ -3,26 +3,7 @@ language: go
go:
- 1.7
before_install:
- go get golang.org/x/tools/cmd/cover
- go get github.com/axw/gocov/gocov
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i removed those "magic" installs as they don't seem to be used anymore

SOURCES := $(shell find $(SOURCEDIR) -name '*.go')
APP_SOURCES := $(shell find $(SOURCEDIR) -name '*.go' -not -path '$(SOURCEDIR)/vendor/*')
VERSION=$(shell cat .goxc.json | python -c "import json,sys;obj=json.load(sys.stdin);print obj['PackageVersion'];")

PATH := $(CURRENTDIR)/bin:$(PATH)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setting this path once for all tests, thanks to running builds with consul on travis we got +10% to coverage for free ;)


all: build

deps:
@./install_consul.sh

build: deps test
build-deps: deps format test check
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build runs goimports before starting build

@janisz
Copy link
Contributor

janisz commented Dec 29, 2016

There is a problem with tarvis build. I restarted it but it failed again.

@coveralls
Copy link

Coverage Status

Coverage increased (+10.1%) to 91.553% when pulling 713cfb8 on travis_with_makefile into cc5e0dd on master.

@adamdubiel
Copy link
Collaborator Author

...and now it passed. Either we get back to not running consul tests with Consul on CI right now, or we wait to see how reliable this tests are in longer run, what do you think?


check: gometalint-exists $(SOURCES)
check: check-deps $(SOURCES)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should follow standard targets so check should do style checking and testing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

@which gover > /dev/null || \
(go get github.com/modocache/gover)

test-coverage: coverage-deps $(SOURCES) $(COVERAGE_TARGETS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to keep one test target. I think test-coverage looks better then current test, the output is cleaner and gives information about coverage.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, that's reasonable, it doesn't seem to be slower

@janisz
Copy link
Contributor

janisz commented Dec 29, 2016

I think we should merge it. I think build hang could be not related to changes you made.

@adamdubiel
Copy link
Collaborator Author

I know its not related to changes, but we might not be happy with builds failing randomly because of consul.

travis.ci configuration uses make commands to be able to replicate CI builds
on local machine
@adamdubiel
Copy link
Collaborator Author

@janisz fixed, now we have 2 targets: test (testing with coverage) and check (test + metalinter)

@coveralls
Copy link

Coverage Status

Coverage increased (+10.1%) to 91.553% when pulling 26407f5 on travis_with_makefile into cc5e0dd on master.

@adamdubiel adamdubiel merged commit bf8030b into master Dec 29, 2016
@adamdubiel adamdubiel deleted the travis_with_makefile branch December 29, 2016 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants