-
Notifications
You must be signed in to change notification settings - Fork 27
/
.travis.yml
31 lines (31 loc) · 1.5 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
language: go
sudo: false
go:
- 1.11.x
- 1.12.x
env:
- REDIS_ADDR="localhost:6379" APPENGINE_DEV_APPSERVER="$HOME/google-cloud-sdk/bin/dev_appserver.py" GO111MODULE="on" DATASTORE_EMULATOR_HOST="localhost:8432" DATASTORE_PROJECT_ID="nds-test"
services:
- redis-server
before_install:
- curl https://sdk.cloud.google.com > install.sh && chmod +x install.sh
install:
- "./install.sh --disable-prompts"
- "$HOME/google-cloud-sdk/bin/gcloud components install beta --quiet"
- "$HOME/google-cloud-sdk/bin/gcloud components install cloud-datastore-emulator --quiet"
- "$HOME/google-cloud-sdk/bin/gcloud components install app-engine-python --quiet"
- "$HOME/google-cloud-sdk/bin/gcloud components install app-engine-go --quiet"
- go get -v -d -t ./...
- go get github.com/golangci/golangci-lint/cmd/golangci-lint
before_script:
- "$HOME/google-cloud-sdk/bin/gcloud config set project nds-test"
- "$HOME/google-cloud-sdk/bin/gcloud beta emulators datastore start --quiet --no-store-on-disk --consistency=1 --host-port=localhost:8432 &"
- timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' $DATASTORE_EMULATOR_HOST)" != "200" ]]; do sleep 5; done' || false
script:
- go test -covermode=count -coverprofile=profile.cov -coverpkg=$(go list ./... | grep -v '/vendor/' | paste -sd, -) ./...
- go test -race ./...
- golangci-lint run ./...
after_success:
- go get -v github.com/mattn/goveralls
- export PATH=$PATH:$HOME/gopath/bin
- goveralls -coverprofile=profile.cov -service=travis-ci