Skip to content

Commit f2849a8

Browse files
authored
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
1 parent f0375eb commit f2849a8

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

.travis.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@ env:
66
- GO111MODULE=on
77
- GO111MODULE=off
88
go: [ 1.11.x, 1.12.x ]
9-
os: [ linux, osx, windows ]
9+
os: [ linux, osx ]
10+
matrix:
11+
exclude:
12+
- go: 1.12.x
13+
env: GO111MODULE=off
14+
- go: 1.11.x
15+
os: osx
1016
install:
17+
- ./travis/install.sh
1118
- if [[ "$GO111MODULE" == "on" ]]; then go mod download; fi
1219
- if [[ "$GO111MODULE" == "off" ]]; then go get github.com/stretchr/testify/assert golang.org/x/sys/unix github.com/konsorten/go-windows-terminal-sequences; fi
1320
script:
21+
- ./travis/cross_build.sh
1422
- export GOMAXPROCS=4
1523
- export GORACE=halt_on_error=1
1624
- go test -race -v ./...

travis/cross_build.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
if [[ "$TRAVIS_GO_VERSION" =~ ^1.\12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
4+
/tmp/gox/gox -build-lib -all -os '!plan9 !nacl'
5+
fi

travis/install.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [[ "$TRAVIS_GO_VERSION" =~ ^1.\12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
6+
git clone https://github.com/dgsb/gox.git /tmp/gox
7+
pushd /tmp/gox
8+
git checkout new_master
9+
go build ./
10+
popd
11+
fi

0 commit comments

Comments
 (0)