Skip to content

Commit

Permalink
add full cross compilation in travis (sirupsen#963)
Browse files Browse the repository at this point in the history
* add full cross compilation in travis

* reduce the travis build matrix

* disable cross build for plan9 and nacl
  • Loading branch information
dgsb authored May 18, 2019
1 parent f0375eb commit f2849a8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@ env:
- GO111MODULE=on
- GO111MODULE=off
go: [ 1.11.x, 1.12.x ]
os: [ linux, osx, windows ]
os: [ linux, osx ]
matrix:
exclude:
- go: 1.12.x
env: GO111MODULE=off
- go: 1.11.x
os: osx
install:
- ./travis/install.sh
- if [[ "$GO111MODULE" == "on" ]]; then go mod download; fi
- if [[ "$GO111MODULE" == "off" ]]; then go get github.com/stretchr/testify/assert golang.org/x/sys/unix github.com/konsorten/go-windows-terminal-sequences; fi
script:
- ./travis/cross_build.sh
- export GOMAXPROCS=4
- export GORACE=halt_on_error=1
- go test -race -v ./...
Expand Down
5 changes: 5 additions & 0 deletions travis/cross_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

if [[ "$TRAVIS_GO_VERSION" =~ ^1.\12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
/tmp/gox/gox -build-lib -all -os '!plan9 !nacl'
fi
11 changes: 11 additions & 0 deletions travis/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -e

if [[ "$TRAVIS_GO_VERSION" =~ ^1.\12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
git clone https://github.com/dgsb/gox.git /tmp/gox
pushd /tmp/gox
git checkout new_master
go build ./
popd
fi

0 comments on commit f2849a8

Please sign in to comment.