-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
38 lines (30 loc) · 1.39 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
language: go
go:
- 1.x
git:
depth: 1
notifications:
email: false
services:
- docker
env:
- PG_VERSION=11
- PG_VERSION=10
- PG_VERSION=9.6
- PG_VERSION=9.5
- PG_VERSION=9.4
before_install:
- sudo /etc/init.d/postgresql stop
- docker run -d --name postgres -e "POSTGRES_USER=user" -e "POSTGRES_PASSWORD=pass" -e "POSTGRES_DB=testdb" -p 5432:5432 postgres:$PG_VERSION -c "shared_preload_libraries=pg_stat_statements"
- go get golang.org/x/tools/cmd/cover
- go get github.com/mattn/goveralls
before_script:
- while ! pg_isready -h localhost -p 5432 -q;do echo "postgres unavailable - sleep 1";sleep 1;done;echo "postgres running";
- PGPASSWORD=pass psql -c 'create extension pg_stat_statements;' -U user -h localhost -p 5432 testdb
- PGPASSWORD=pass psql -c 'create sequence text_seq;' -U user -h localhost -p 5432 testdb
- PGPASSWORD=pass psql -c "create function i() returns integer as \$\$ begin return 1; end; \$\$ language plpgsql; set track_functions='pl';select i();" -U user -h localhost -p 5432 testdb
- PGPASSWORD=pass pgbench -i -q -U user -h localhost -p 5432 testdb
- PGPASSWORD=pass pgbench -T 5 -U user -h localhost -p 5432 testdb
script:
- go test -v -tags integration -covermode=count -coverprofile=coverage.out -user=user -password=pass -dbname=testdb
- $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN