@@ -3,59 +3,55 @@ language: go
33
44os :
55 - linux
6- - osx
76
87go :
98 - 1.8
109
1110env :
12- - GOFLAGS=''
11+ - WITH_COVERAGE=true
1312 - GOFLAGS='-race'
14- - GOFLAGS='--tags batched_queue'
1513 - GOFLAGS='-race --tags batched_queue'
16- - GOFLAGS='' WITH_ETCD=true
17- - GOFLAGS='-race' WITH_ETCD=true
18- - GOFLAGS='--tags pkcs11' WITH_PKCS11=true
19- - GOFLAGS='-race --tags pkcs11' WITH_PKCS11=true
14+ - GOFLAGS='-race' WITH_ETCD=true
15+ - GOFLAGS='-race --tags pkcs11' WITH_PKCS11=true
2016
2117matrix :
2218 fast_finish : true
2319 allow_failures :
2420 - os : osx
25- exclude :
26- - os : osx
27- env : GOFLAGS= WITH_PKCS11=true
28- - os : osx
29- env : GOFLAGS=-race WITH_PKCS11=true
21+ include :
22+ - os : osx # Run only "vanilla" tests on osx
23+ env :
24+
25+ services : mysql
3026
3127install :
32- - if [[ "${WITH_PKCS11}" == "true" ]]; then sudo apt-get install softhsm ; fi
28+ - if [[ "${WITH_PKCS11}" == "true" ]]; then sudo apt-get install -y softhsm ; fi
3329 - |
34- if [ ! -d $HOME/gopath/src/github.com/google ]; then
35- mkdir -p $HOME/gopath/src/github.com/google
36- ln -s $TRAVIS_BUILD_DIR $HOME/gopath/src/github.com/google/trillian
30+ if [ ! -d " $HOME/gopath/src/github.com/google" ]; then
31+ mkdir -p " $HOME/gopath/src/github.com/google"
32+ ln -s " $TRAVIS_BUILD_DIR" " $HOME/gopath/src/github.com/google/trillian"
3733 fi
3834 - mkdir ../protoc
3935 - |
4036 (
4137 cd ../protoc
42- wget https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-${TRAVIS_OS_NAME}-x86_64.zip
43- unzip protoc-3.2.0-${TRAVIS_OS_NAME}-x86_64.zip
38+ wget " https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-${TRAVIS_OS_NAME}-x86_64.zip"
39+ unzip " protoc-3.2.0-${TRAVIS_OS_NAME}-x86_64.zip"
4440 )
45- - export PATH=$(pwd)/../protoc/bin:$PATH
41+ - export PATH=" $(pwd)/../protoc/bin:$PATH"
4642 # googleapis is not Go code, but it's required for .pb.go regeneration because of API dependencies.
47- - git clone https://github.com/googleapis/googleapis.git $GOPATH/src/github.com/googleapis/googleapis
43+ - git clone --depth=1 https://github.com/googleapis/googleapis.git " $GOPATH/src/github.com/googleapis/googleapis"
4844 - go get ${GOFLAGS} -d -t ./...
49- - if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew update > /dev/null && brew install mariadb && mysql.server start; fi
50- - go get -u github.com/client9/misspell/cmd/misspell
51- - go get -u github.com/fzipp/gocyclo
52- - go get -u github.com/gordonklaus/ineffassign
53- - go get -u github.com/golang/lint/golint
54- - go get -u github.com/golang/protobuf/proto
55- - go get -u github.com/golang/protobuf/protoc-gen-go
56- - go get -u github.com/kisielk/errcheck
57- - go get -u golang.org/x/tools/cmd/stringer
58- - go get -u github.com/google/certificate-transparency-go
45+ - if [[ " $TRAVIS_OS_NAME" == "osx" ]]; then brew update > /dev/null && brew install mariadb && mysql.server start; fi
46+ - go get github.com/client9/misspell/cmd/misspell
47+ - go get github.com/fzipp/gocyclo
48+ - go get github.com/gordonklaus/ineffassign
49+ - go get github.com/golang/lint/golint
50+ - go get github.com/golang/protobuf/proto
51+ - go get github.com/golang/protobuf/protoc-gen-go
52+ - go get github.com/kisielk/errcheck
53+ - go get golang.org/x/tools/cmd/stringer
54+ - go get github.com/google/certificate-transparency-go
5955 - go get -d -t github.com/google/certificate-transparency-go/...
6056 - go install github.com/golang/{mock/mockgen,protobuf/protoc-gen-go}
6157 # install vendored protoc-gen-grpc-gateway binary
@@ -64,10 +60,13 @@ install:
6460 - go install ./vendor/github.com/coreos/etcd/cmd/etcd
6561 - go install ./vendor/github.com/coreos/etcd/cmd/etcdctl
6662
63+ before_script :
64+ - yes | ./scripts/resetdb.sh
65+
6766script :
6867 - set -e
69- - cd $HOME/gopath/src/github.com/google/trillian
70- - ./scripts/presubmit.sh
68+ - cd " $HOME/gopath/src/github.com/google/trillian"
69+ - ./scripts/presubmit.sh ${WITH_COVERAGE:+--coverage}
7170 - |
7271 # Check re-generation didn't change anything
7372 # Skip protoc-generated files (.pb.go) because protoc is not deterministic
@@ -84,17 +83,15 @@ script:
8483 export ETCD_DIR="${GOPATH}/bin"
8584 fi
8685 - ./integration/integration_test.sh
87- - cd $HOME/gopath/src/github.com/google/certificate-transparency-go
86+ - cd " $HOME/gopath/src/github.com/google/certificate-transparency-go"
8887 - ./trillian/integration/integration_test.sh
8988 - cd $HOME/gopath/src/github.com/google/trillian
9089 - HAMMER_OPTS="--operations=50" ./integration/maphammer.sh 3
9190 - set +e
9291
93- services : mysql
94-
95- before_script :
96- - yes | ./scripts/resetdb.sh
97-
9892after_success :
99- - cp /tmp/coverage.txt .
100- - bash <(curl -s https://codecov.io/bash)
93+ - |
94+ if [[ -f /tmp/coverage.txt ]]; then
95+ cp /tmp/coverage.txt .
96+ bash <(curl -s https://codecov.io/bash)
97+ fi
0 commit comments