diff --git a/.travis.yml b/.travis.yml index 760b5bb..7efdcdc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,43 +1,37 @@ language: go -sudo: false -go: - - 1.9.x - - 1.10.x - - 1.11.x - - 1.12.x - - 1.13.x - - 1.14.x - - tip os: - linux - osx + - windows + +go: + - 1.14.x + - 1.13.x + - 1.12.x + - 1.11.x + - tip -before_install: - - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.27.0 - - go get -v ./... +before_script: + - go get -t -v ./... script: - # lint (go version >= 1.11, gotip not supported) - - | - if [[ $(go version | awk '{print $3}') =~ ^go1.1[1-9]$ ]]; then - golangci-lint run - fi + - go test -v -cover -race ./... - # build test for supported platforms - - GOOS=linux go build ./... - - GOOS=darwin go build ./... - - GOOS=freebsd go build ./... - - GOOS=windows go build ./... - - | - if [[ $(uname) == Darwin ]]; then - # Last supported version for GOOS=386 is go1.14 in Darwin - if [[ $(go version | awk '{print $3}') =~ ^go1\.(9|10|11|12|13|14)$ ]]; then - GOARCH=386 go build ./... - fi - else - GOARCH=386 go build ./... - fi +jobs: + allow_failures: + - go: tip - # run tests - - go test -v -cover -race ./... + include: + - stage: lint + script: + - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.27.0 + - golangci-lint run + + - stage: cross compilation + script: + - GOOS=linux go build + - GOOS=darwin go build + - GOOS=freebsd go build + - GOOS=windows go build + - GOARCH=386 go build