From 1d2f2c5ebb0fab5fa9bec8f2f9ce4a46052dcd7f Mon Sep 17 00:00:00 2001 From: Sergio Andres Virviescas Santana Date: Wed, 17 Jun 2020 15:13:50 +0200 Subject: [PATCH] Update travis file --- .travis.yml | 60 ++++++++++++++++++++++++----------------------------- 1 file changed, 27 insertions(+), 33 deletions(-) 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