Browse Source

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
tags/v1.4.2
David Bariod 6 months ago
parent
commit
f2849a8fb2
No account linked to committer's email address
3 changed files with 25 additions and 1 deletions
  1. 9
    1
      .travis.yml
  2. 5
    0
      travis/cross_build.sh
  3. 11
    0
      travis/install.sh

+ 9
- 1
.travis.yml View File

@@ -6,11 +6,19 @@ env:
6 6
   - GO111MODULE=on
7 7
   - GO111MODULE=off
8 8
 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
10 16
 install:
17
+  - ./travis/install.sh
11 18
   - if [[ "$GO111MODULE" ==  "on" ]]; then go mod download; fi
12 19
   - if [[ "$GO111MODULE" == "off" ]]; then go get github.com/stretchr/testify/assert golang.org/x/sys/unix github.com/konsorten/go-windows-terminal-sequences; fi
13 20
 script:
21
+  - ./travis/cross_build.sh
14 22
   - export GOMAXPROCS=4
15 23
   - export GORACE=halt_on_error=1
16 24
   - go test -race -v ./...

+ 5
- 0
travis/cross_build.sh View File

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

+ 11
- 0
travis/install.sh View File

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

Loading…
Cancel
Save