-
Notifications
You must be signed in to change notification settings - Fork 246
/
.travis.yml
37 lines (30 loc) · 1.03 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
language: go
os:
- linux
- osx
install:
# Use gofmt from Go 1.9 for the pre-build check on all builds
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then wget -O go.tar.gz https://storage.googleapis.com/golang/go1.9.darwin-amd64.tar.gz; else wget -O go.tar.gz https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz; fi
- tar -C /tmp -xvf go.tar.gz go/bin/gofmt
- rm go.tar.gz
before_script:
- /tmp/go/bin/gofmt -w .
# If `go generate` or `gofmt` yielded any changes,
# this will fail with an error message like "too many arguments"
# or "M: binary operator expected" and show the diff.
- git diff
- git add .
- git diff-index --cached --exit-code HEAD
go:
- 1.6
- 1.7
- 1.8
- 1.9
- tip
matrix:
exclude:
- os: osx
go: 1.6
script:
- echo $TRAVIS_GO_VERSION
- if [ "$TRAVIS_GO_VERSION" == "1.6" ] || [ "$TRAVIS_GO_VERSION" == "1.7" ] || [ "$TRAVIS_GO_VERSION" == "1.8" ]; then go list ./... | grep -v vendor | xargs go test -race -v -timeout 60s; else go test -race -v -timeout 60s ./...; fi