forked from dbsteward/dbsteward
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
executable file
·54 lines (47 loc) · 2.19 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
language: php
php:
- 5.5
- 5.6
- 7.0
dist: precise
sudo: false
env:
# global env vars are injected into the environment of all build configs
global:
- TRAVIS_MYSQL5_DBHOST=127.0.0.1
- TRAVIS_MYSQL5_DBPORT=3306
- TRAVIS_MYSQL5_DBUSER=travis
- TRAVIS_MYSQL5_DBPASS=
- TRAVIS_MYSQL5_DBNAME_MGMT=mysql
- TRAVIS_MYSQL5_DBUSER_MGMT=root
- TRAVIS_MYSQL5_DBPASS_MGMT=
- TRAVIS_PGSQL8_DBHOST=127.0.0.1
- TRAVIS_PGSQL8_DBPORT=5432
- TRAVIS_PGSQL8_DBUSER=deployment
- TRAVIS_PGSQL8_DBPASS=password1
- TRAVIS_PGSQL8_DBNAME_MGMT=postgres
- TRAVIS_PGSQL8_DBUSER_MGMT=postgres
- TRAVIS_PGSQL8_DBPASS_MGMT=
# matrix env vars generate a new build config per set
# we need to run the two test groups separately due to active_sql_format_autoloader
matrix:
- PHPUNIT_GROUP=pgsql8
- PHPUNIT_GROUP=mysql5
# for now, only build the dev-travis branch
# branches:
# only:
# - dev-travis
before_script:
# psql is failing to connect here sometimes, sleep a little
# - sleep 2
- composer install --dev --no-interaction
- if [[ "$PHPUNIT_GROUP" == "pgsql8" ]]; then psql -U postgres -d postgres -c "CREATE USER deployment WITH SUPERUSER CREATEDB CREATEROLE PASSWORD 'password1';"; fi
- if [[ "$PHPUNIT_GROUP" == "pgsql8" ]]; then psql -U postgres -d postgres -c "CREATE ROLE dbsteward_phpunit_app;"; fi
- if [[ "$PHPUNIT_GROUP" == "pgsql8" ]]; then PGPASSWORD=password1 psql -U deployment -d postgres -c "CREATE DATABASE dbsteward_phpunit;"; fi
- if [[ "$PHPUNIT_GROUP" == "pgsql8" ]]; then psql -U postgres -d dbsteward_phpunit -c "CREATE OR REPLACE LANGUAGE plpgsql;"; fi
- if [[ "$PHPUNIT_GROUP" == "mysql5" ]]; then mysql -u root -D mysql -e "GRANT ALL ON *.* TO travis@'%', dbsteward_pu_app@'%', deployment@'%' WITH GRANT OPTION;"; fi
- if [[ "$PHPUNIT_GROUP" == "mysql5" ]]; then mysql -u root -D mysql -e "DROP DATABASE IF EXISTS dbsteward_phpunit; CREATE DATABASE dbsteward_phpunit;"; fi
- composer install --dev --no-interaction
# by default, travis just runs "phpunit", but our tests are in the tests directory
script: vendor/bin/phpunit --verbose --debug --group $PHPUNIT_GROUP --coverage-clover clover.xml tests/
after_script: vendor/bin/coveralls -v