forked from nyaruka/courier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
44 lines (37 loc) · 1.43 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
language: go
go:
- "1.11"
env:
global:
- GO111MODULE=on
matrix:
- PGDB=10
- PGDB=9.6
services:
- redis-server
before_install:
- sudo -E service postgresql stop 9.2
- sudo -E service postgresql stop 9.3
- sudo -E service postgresql stop 9.4
- sudo -E service postgresql stop 9.5
- sudo -E service postgresql stop 9.6
- sudo -E apt-get -yq --no-install-suggests --no-install-recommends $(travis_apt_get_options) install postgresql-$PGDB postgresql-client-$PGDB
- sudo -E sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf
- sudo -E sed -i 's/port = 5433/port = 5432/' /etc/postgresql/*/main/postgresql.conf
- sudo -E service postgresql restart $PGDB
# setup redis
- sudo sed -e 's/^bind.*/bind 127.0.0.1/' /etc/redis/redis.conf > redis.conf
- sudo mv redis.conf /etc/redis
- sudo service redis-server start
- echo PING | nc localhost 6379
before_script:
- psql -U postgres -c "CREATE USER courier WITH PASSWORD 'courier';"
- psql -U postgres -c "ALTER ROLE courier WITH SUPERUSER;"
- psql -U postgres -c "CREATE DATABASE courier_test;"
- psql -U postgres -d courier_test -f backends/rapidpro/schema.sql
script:
- go test -p=1 -coverprofile=coverage.text -covermode=atomic github.com/nyaruka/courier/...
after_success:
- bash <(curl -s https://codecov.io/bash)
- rm coverage.text
- test -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | bash