add full cross compilation in travis (#963)

* add full cross compilation in travis

* reduce the travis build matrix

* disable cross build for plan9 and nacl
This commit is contained in:
David Bariod 2019-05-18 10:27:12 +02:00 committed by GitHub
parent f0375eb5b5
commit f2849a8fb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 1 deletions

View File

@ -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 ./...

5
travis/cross_build.sh Executable file
View File

@ -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
travis/install.sh Executable file
View File

@ -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