-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
58 lines (52 loc) · 2.46 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
dist: bionic
language: php
php:
- 7.2
- 7.3
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
env:
- PGVERSION=9.4
- PGVERSION=9.5
- PGVERSION=9.6
- PGVERSION=10
- PGVERSION=11
- PGVERSION=12
- PGVERSION=13
- PGVERSION=14
- PGVERSION=15
- PGVERSION=16
# taken from https://coderwall.com/p/tzj3cq/smoking-against-different-postgresql-versions-with-travis-ci
before_install:
- sudo /etc/init.d/postgresql stop
- sudo apt-get -y --purge remove postgresql libpq-dev libpq5 postgresql-client-common postgresql-common
- sudo rm -rf /var/lib/postgresql
- sudo apt-get update -qq
- sudo apt-get -y install postgresql-$PGVERSION postgresql-contrib-$PGVERSION postgresql-client-$PGVERSION language-pack-cs language-pack-ja
- sudo chmod 777 /etc/postgresql/$PGVERSION/main/postgresql.conf
- sudo echo "max_prepared_transactions = 1" >> "/etc/postgresql/$PGVERSION/main/postgresql.conf"
- sudo chmod 777 /etc/postgresql/$PGVERSION/main/pg_hba.conf
- sudo echo "local all postgres trust" > /etc/postgresql/$PGVERSION/main/pg_hba.conf
- sudo echo "local all all trust" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
- sudo echo "host all all 127.0.0.1/32 trust" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
- sudo echo "host all all ::1/128 trust" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
- sudo /etc/init.d/postgresql restart
- psql -U postgres -c "SELECT version(), current_setting('max_prepared_transactions')"
- composer self-update
install:
- composer install
before_script:
- psql -U postgres -c "CREATE USER ivory PASSWORD 'ivoryivory' SUPERUSER NOCREATEDB NOCREATEROLE"
- psql -U postgres -c "CREATE DATABASE ivory_test OWNER ivory"
- psql -U postgres -d ivory_test -c "CREATE EXTENSION IF NOT EXISTS hstore"
- cp test/phpunit.template.xml test/phpunit.xml
- sed -e 's~\(name="DB_HOST" value="\).*\("\)~\1\2~' --in-place test/phpunit.xml
- sed -e 's~\(name="DB_PORT" value="\).*\("\)~\1\2~' --in-place test/phpunit.xml
- sed -e 's~\(name="DB_USER" value="\).*\("\)~\1ivory\2~' --in-place test/phpunit.xml
- sed -e 's~\(name="DB_PASSWD" value="\).*\("\)~\1ivoryivory\2~' --in-place test/phpunit.xml
- sed -e 's~\(name="DB_DBNAME" value="\).*\("\)~\1ivory_test\2~' --in-place test/phpunit.xml
script:
- composer run-script test