diff --git a/.travis.yml b/.travis.yml index 635b5cd07..647b4ee43 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,23 @@ language: go sudo: false -go: - - 1.12.x - - 1.13.x + go_import_path: go.uber.org/zap env: global: - TEST_TIMEOUT_SCALE=10 - GO111MODULE=on + +matrix: + include: + - go: 1.12.x + - go: 1.13.x + env: LINT=1 + script: - - make lint + - test -z "$LINT" || make lint - make test - make bench + after_success: - make cover - bash <(curl -s https://codecov.io/bash) diff --git a/Makefile b/Makefile index 42819f9a3..21e436c45 100644 --- a/Makefile +++ b/Makefile @@ -13,22 +13,11 @@ GO_FILES := $(shell \ find . '(' -path '*/.*' -o -path './vendor' ')' -prune \ -o -name '*.go' -print | cut -b3-) -# The linting tools evolve with each Go version, so run them only on the -# latest stable release. -GO_VERSION := $(shell go version | cut -d " " -f 3) -GO_MINOR_VERSION := $(word 2,$(subst ., ,$(GO_VERSION))) -LINTABLE_MINOR_VERSIONS := 13 - -ifneq ($(filter $(LINTABLE_MINOR_VERSIONS),$(GO_MINOR_VERSION)),) -SHOULD_LINT := true -endif - .PHONY: all all: lint test .PHONY: lint lint: $(GOLINT) -ifdef SHOULD_LINT @rm -rf lint.log @echo "Checking formatting..." @gofmt -d -s $(GO_FILES) 2>&1 | tee lint.log @@ -41,9 +30,6 @@ ifdef SHOULD_LINT @echo "Checking for license headers..." @./checklicense.sh | tee -a lint.log @[ ! -s lint.log ] -else - @echo "Skipping linters on" $(GO_VERSION) -endif $(GOLINT): go install golang.org/x/lint/golint