Skip to content

Commit

Permalink
Exclude go1.13.x from modules off, only build all on go1.13 modules on
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Muller committed Oct 14, 2019
1 parent 08cf62c commit 68e6dbb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ env:
- GO111MODULE=off
go: [1.11.x, 1.12.x, 1.13.x]
os: [linux, osx]
matrix:
exclude:
- go: 1.13.x
env: GO111MODULE=off ## Modules are the default now.
install:
- ./travis/install.sh
script:
Expand Down
2 changes: 1 addition & 1 deletion travis/cross_build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

if [[ "$TRAVIS_GO_VERSION" =~ ^1\.12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
if [[ "$TRAVIS_GO_VERSION" =~ ^1\.13\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$GO111MODULE" == "on" ]]; then
$(go env GOPATH)/bin/gox -build-lib
fi
6 changes: 4 additions & 2 deletions travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

set -e

if [[ "$TRAVIS_GO_VERSION" =~ ^1\.12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
# Only do this for go1.12 when modules are on so that it doesn't need to be done when modules are off as well.
if [[ "$TRAVIS_GO_VERSION" =~ ^1\.13\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$GO111MODULE" == "on" ]]; then
GO111MODULE=off go get github.com/dgsb/gox
fi

Expand All @@ -11,5 +12,6 @@ if [[ "$GO111MODULE" == "on" ]]; then
fi

if [[ "$GO111MODULE" == "off" ]]; then
go get github.com/stretchr/testify/assert golang.org/x/sys/unix github.com/konsorten/go-windows-terminal-sequences
# Should contain all regular (not indirect) modules from go.mod
go get github.com/stretchr/testify golang.org/x/sys/unix github.com/konsorten/go-windows-terminal-sequences
fi

0 comments on commit 68e6dbb

Please sign in to comment.