Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
travis: use go modules and latest Go (#205)
* travis: update build steps Leveraging go modules. Also using "1.x" as the version of Go to ensure we always get the latest. go.sum changed after a go mod tidy x) * travis: add cache * Makefile: fix targets * travis: split pretest and coverage This way, travis can show us how long pretest and coverage take, separately. * travis: install goveralls before anything else * travis: debug * travis: debugged
- Loading branch information
Showing
5 changed files
with
48 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
language: go | ||
|
||
cache: | ||
directories: | ||
- $GOPATH/pkg | ||
before_install: | ||
# Decrypts a script that installs an authenticated cookie | ||
# for git to use when cloning from googlesource.com. | ||
# Bypasses "bandwidth limit exceeded" errors. | ||
# See github.com/golang/go/issues/12933 | ||
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then openssl aes-256-cbc -K $encrypted_83935ad6c1b7_key -iv $encrypted_83935ad6c1b7_iv -in gitcookies.sh.enc -out gitcookies.sh -d; fi | ||
- go get github.com/axw/gocov/gocov | ||
- go get github.com/mattn/goveralls | ||
- go get golang.org/x/tools/cmd/cover | ||
|
||
- export GOCACHE=$GOPATH/pkg/cache | ||
- go get github.com/mattn/goveralls@master | ||
install: | ||
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash gitcookies.sh; fi | ||
|
||
- make deps | ||
script: | ||
- make test | ||
- make pretest | ||
- make coverage | ||
|
||
env: | ||
global: | ||
- GO111MODULE=on | ||
go: | ||
- "1.11.x" | ||
- 1.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,34 @@ | ||
all: test | ||
|
||
deps: | ||
go get -d -v github.com/NYTimes/gizmo/... | ||
|
||
updatedeps: | ||
go get -d -v -u -f github.com/NYTimes/gizmo/... | ||
|
||
testdeps: | ||
go get -d -v -t github.com/NYTimes/gizmo/... | ||
|
||
updatetestdeps: | ||
go get -d -v -t -u -f github.com/NYTimes/gizmo/... | ||
go mod download | ||
|
||
build: deps | ||
go build github.com/NYTimes/gizmo/... | ||
go build ./... | ||
|
||
install: deps | ||
go install github.com/NYTimes/gizmo/... | ||
go install ./... | ||
|
||
lint: testdeps | ||
go get -v golang.org/x/lint/golint | ||
lint: deps | ||
GO111MODULE=off go get golang.org/x/lint/golint | ||
for file in $$(find . -name '*.go' | grep -v '\.pb\.go\|\.pb\.gw\.go\|examples\|pubsub\/aws\/awssub_test\.go' | grep -v 'server\/kit\/kitserver_pb_test\.go'); do \ | ||
golint $${file}; \ | ||
if [ -n "$$(golint $${file})" ]; then \ | ||
exit 1; \ | ||
fi; \ | ||
golint -set_exit_status $${file}; \ | ||
done | ||
|
||
vet: testdeps | ||
go vet github.com/NYTimes/gizmo/... | ||
|
||
errcheck: testdeps | ||
go get -v github.com/kisielk/errcheck | ||
errcheck -ignoretests github.com/NYTimes/gizmo/... | ||
|
||
pretest: lint vet # errcheck | ||
|
||
test: testdeps pretest | ||
go test github.com/NYTimes/gizmo/... | ||
pretest: lint | ||
|
||
clean: | ||
go clean -i github.com/NYTimes/gizmo/... | ||
test: deps pretest | ||
go test -vet all ./... | ||
|
||
coverage: testdeps | ||
coverage: deps | ||
./coverage.sh --coveralls | ||
|
||
.PHONY: \ | ||
all \ | ||
deps \ | ||
updatedeps \ | ||
testdeps \ | ||
updatetestdeps \ | ||
build \ | ||
install \ | ||
lint \ | ||
vet \ | ||
errcheck \ | ||
pretest \ | ||
test \ | ||
clean \ | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters