forked from stripe/veneur
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
57 lines (49 loc) · 1.92 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
language: go
go:
- 1.8
- 1.9
- tip
install:
- wget https://github.com/google/protobuf/releases/download/v3.1.0/protoc-3.1.0-linux-x86_64.zip
- unzip protoc-3.1.0-linux-x86_64.zip -d /tmp
- sudo cp /tmp/bin/protoc /usr/bin/protoc
- sudo chmod 777 /usr/bin/protoc
- rm protoc-3.1.0-linux-x86_64.zip
# After 1.9 hits stable, replace this link
# It is only used for gofmt
- wget https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz
- tar -C /tmp -xvf go1.9.linux-amd64.tar.gz go/bin/gofmt
- sudo mv /tmp/go/bin/gofmt /usr/bin/gofmt
- rm go1.9.linux-amd64.tar.gz
before_script:
- go get -u github.com/ChimeraCoder/gojson/gojson
- go get -u github.com/golang/protobuf/protoc-gen-go
- go get -d -v github.com/gogo/protobuf/protoc-gen-gofast
- pushd $GOPATH/src/github.com/gogo/protobuf
- git fetch
- git checkout v0.5
- popd
- go install github.com/gogo/protobuf/protoc-gen-gofast
- go get -u github.com/golang/dep/cmd/dep
- go get -u golang.org/x/tools/cmd/stringer
# This is needed to fix https://github.com/golang/go/issues/21387
- if [ "$TRAVIS_GO_VERSION" = "1.8" ]; then go install; fi
- go generate
# We need to ignore changes to this one file
# because the go-generated version will have a different
# fileDescriptor0 depending on which version of Go was used
# to build protoc-gen-go.
- git checkout ssf/sample.pb.go
- dep ensure -v
# We need to use gofmt built with 1.9+
# on *all* builds
# because some vendored files use type alias syntax
- /usr/bin/gofmt -w .
# See the corresponding lines in the Dockerfile for an explanation
# of this logic
- git add .
- git diff --cached
- git diff-index --cached --exit-code HEAD
script:
- if [ "$TRAVIS_GO_VERSION" = "1.8" ]; then go list ./... | grep -v vendor | xargs go test -race -v -timeout 60s; fi
- if [ "$TRAVIS_GO_VERSION" != "1.8" ]; then echo $TRAVIS_GO_VERSION; go test -race -v -timeout 60s ./...; fi