forked from google/trillian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
110 lines (98 loc) · 3.53 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
sudo: true # Only to move mysql onto ramdisk.
os: linux
dist: xenial
language: go
go: "1.11.x"
go_import_path: github.com/google/trillian
addons:
apt:
packages:
- softhsm
cache:
directories:
- "$HOME/google-cloud-sdk/"
env:
- WITH_COVERAGE=true
- GOFLAGS='-race'
- GOFLAGS='-race --tags=batched_queue'
- GOFLAGS='-race' WITH_ETCD=true
- GOFLAGS='-race --tags=pkcs11' WITH_PKCS11=true
- WITH_DOCKER_TESTS=true
matrix:
fast_finish: true
allow_failures:
- env: WITH_DOCKER_TESTS=true
services:
- docker
- postgresql
- mysql
before_install:
- sudo service mysql stop
- |
if [[ "$TRAVIS_SUDO" == "true" ]]; then
echo "Moving MySQL data to ramdisk..."
sudo mkdir /mnt/ramdisk
sudo mount -t tmpfs -o size=1024m tmpfs /mnt/ramdisk
sudo mv /var/lib/mysql /mnt/ramdisk
sudo ln -s /mnt/ramdisk/mysql /var/lib/mysql
else
echo "MySQL data staying on disk because sudo unavailable."
fi
- sudo service mysql start
install:
- mkdir ../protoc
- |
(
cd ../protoc
wget "https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-${TRAVIS_OS_NAME}-x86_64.zip"
unzip "protoc-3.5.1-${TRAVIS_OS_NAME}-x86_64.zip"
)
- export PATH="$(pwd)/../protoc/bin:$PATH"
# googleapis is not Go code, but it's required for .pb.go regeneration because of API dependencies.
- git clone --depth=1 https://github.com/googleapis/googleapis.git "$GOPATH/src/github.com/googleapis/googleapis"
- go get ${GOFLAGS} -d -t ./...
- go get -d -t github.com/google/certificate-transparency-go/...
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.12.5
- go get github.com/golang/protobuf/proto
- go get github.com/golang/protobuf/protoc-gen-go
- go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
- go get github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
- go get github.com/golang/mock/mockgen
- go get golang.org/x/tools/cmd/stringer
# install vendored etcd binary
- go install ./vendor/github.com/coreos/etcd/cmd/etcd
- go install ./vendor/github.com/coreos/etcd/cmd/etcdctl
before_script:
- ./scripts/resetdb.sh --force
- ./scripts/mysqlconnlimit.sh --force
- ./scripts/postgres_resetdb.sh --force
script:
- set -e
- cd "$HOME/gopath/src/github.com/google/trillian"
- export GO_TEST_TIMEOUT=20m
- ./scripts/presubmit.sh ${WITH_COVERAGE:+--coverage}
- |
# Check re-generation didn't change anything. Skip protoc-generated files
# because protoc is not deterministic when generating file descriptors.
echo "Checking that generated files are the same as checked-in versions."
git diff --exit-code -- ':!*.pb.go' ':!*_string.go'
- |
if [[ "${WITH_ETCD}" == "true" ]]; then
export ETCD_DIR="${GOPATH}/bin"
fi
- |
./integration/integration_test.sh
cd "$HOME/gopath/src/github.com/google/certificate-transparency-go"
./trillian/integration/integration_test.sh
cd $HOME/gopath/src/github.com/google/trillian
HAMMER_OPTS="--operations=50" ./integration/maphammer.sh 3
- |
# TODO(RJPercival): Make docker-compose integration test work when PKCS#11
# support is enabled. This requires running softhsm in a Docker container.
# See https://github.com/rolandshoemaker/docker-hsm for an example.
if [[ "${WITH_DOCKER_TESTS}" == "true" ]]; then
./integration/docker_compose_integration_test.sh
fi
- set +e
after_success:
- bash <(curl -s https://codecov.io/bash)