-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
42 lines (34 loc) · 1.21 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
dist: xenial
language: go
go:
- "1.x"
# - "tip"
env:
- GO111MODULE=on
services:
- docker
addons:
postgresql: "11"
apt:
packages:
- postgresql-11
- postgresql-client-11
cache:
directories:
- $GOPATH/pkg
- $HOME/.cache/go-build
before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- sudo service postgresql stop
- GO111MODULE=off go get -v -u github.com/mattn/goveralls
- GO111MODULE=off go get -tags 'postgres' -u github.com/golang-migrate/migrate/cmd/migrate
- docker pull zikaeroh/postgres-initialized
- docker run -d -p 127.0.0.1:5432:5432 zikaeroh/postgres-initialized
- while ! curl http://localhost:5432 2>&1 | grep '52'; do sleep 1; done
- migrate -database 'postgres://postgres:mysecretpassword@localhost:5432/postgres?sslmode=disable' -path internal/db/migrations up
script:
- go test -race -covermode=atomic -coverprofile=cover.out ./...
- $GOPATH/bin/goveralls -service=travis-ci -coverprofile=cover.out