From fa2cb9e487545631bdee795b2e437307590af230 Mon Sep 17 00:00:00 2001 From: Pete Moore Date: Wed, 25 Oct 2017 18:42:07 +0200 Subject: [PATCH] Build with go 1.9 in travis --- .travis.yml | 50 ++++++++++++++------------------------------------ 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0cf8d3c5..87038b33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,50 +1,28 @@ language: go - go: - # this is a lie - we will use 1.8.3 which isn't supported yet - # by downloading it later in "before_install" section - # we use 1.8.3 due to https://github.com/contester/runlib/issues/5#issuecomment-241419381 - # which could have also been achieved via vendoring an older version, but for let's - # keep up-to-date with latest version - - 1.6 + - 1.9 env: - - "MY_GOOS=linux MY_GOARCH=amd64" - - "MY_GOOS=darwin MY_GOARCH=amd64" - - "MY_GOOS=windows MY_GOARCH=amd64" - - "MY_GOOS=windows MY_GOARCH=386" - -before_install: - - curl -o go.tar.gz -sL https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz - - tar -C $HOME -xf go.tar.gz - - rm go.tar.gz - - export GOROOT="${HOME}/go" - - export PATH="${GOROOT}/bin:${PATH}" - - export GOOS="${MY_GOOS}" - - export GOARCH="${MY_GOARCH}" - - go version - - go env - - "test $GOOS.$GOARCH != linux.amd64 || go get github.com/axw/gocov/gocov github.com/mattn/goveralls github.com/pierrre/gotestcover" + - "GIMME_OS=linux GIMME_ARCH=amd64" + - "GIMME_OS=darwin GIMME_ARCH=amd64" + - "GIMME_OS=windows GIMME_ARCH=amd64" + - "GIMME_OS=windows GIMME_ARCH=386" install: - - "go get github.com/taskcluster/livelog" - - "go get github.com/gordonklaus/ineffassign" + - "test $GIMME_OS.$GIMME_ARCH != linux.amd64 || go get github.com/axw/gocov/gocov github.com/mattn/goveralls github.com/pierrre/gotestcover github.com/taskcluster/livelog github.com/gordonklaus/ineffassign" script: - - export GOOS=linux - - export GOARCH=amd64 - - "go get ./gw-codegen" - - "go generate" - - "export GOOS=${MY_GOOS}" - - "export GOARCH=${MY_GOARCH}" - - "git status" - - "test $(git status --porcelain | wc -l) == 0" + - "test $GIMME_OS.$GIMME_ARCH != linux.amd64 || go get ./gw-codegen" + - "test $GIMME_OS.$GIMME_ARCH != linux.amd64 || go generate" + - "test $GIMME_OS.$GIMME_ARCH != linux.amd64 || git status" + - "test $GIMME_OS.$GIMME_ARCH != linux.amd64 || test $(git status --porcelain | wc -l) == 0" - "go get -v -t ./..." - - "if test $GOOS.$GOARCH = linux.amd64; then GORACE=history_size=7 travis_wait 30 ${GOPATH}/bin/gotestcover -v -coverprofile=coverage.report -race -timeout 1h ./... && go tool cover -func=coverage.report; fi" - - "test $GOOS.$GOARCH != linux.amd64 || ${GOPATH}/bin/ineffassign ." + - "test $GIMME_OS.$GIMME_ARCH != linux.amd64 || GORACE=history_size=7 travis_wait 30 ${GOPATH}/bin/gotestcover -v -coverprofile=coverage.report -race -timeout 1h ./..." + - "test $GIMME_OS.$GIMME_ARCH != linux.amd64 || go tool cover -func=coverage.report" + - "test $GIMME_OS.$GIMME_ARCH != linux.amd64 || ${GOPATH}/bin/ineffassign ." after_script: - - "test $GOOS.$GOARCH != linux.amd64 || ${GOPATH}/bin/goveralls -coverprofile=coverage.report -service=travis-ci" + - "test $GIMME_OS.$GIMME_ARCH != linux.amd64 || ${GOPATH}/bin/goveralls -coverprofile=coverage.report -service=travis-ci" before_deploy: - "source .travis_rename_releases.sh"