Skip to content
This repository has been archived by the owner on Feb 20, 2020. It is now read-only.

Commit

Permalink
Build with go 1.9 in travis
Browse files Browse the repository at this point in the history
  • Loading branch information
petemoore committed Oct 25, 2017
1 parent 48e92db commit fa2cb9e
Showing 1 changed file with 14 additions and 36 deletions.
50 changes: 14 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit fa2cb9e

Please sign in to comment.