forked from netgen/ezpublish-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
78 lines (70 loc) · 3.47 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
language: php
# run tests on php misc php versions
php:
- 5.4
- 5.5
- 5.6
# execute unit tests, integration test stubs and integration tests using legacy storage engine
env:
global:
- DB_NAME="testdb"
matrix:
# If SYMFONY_VERSION is not specified, will take the latest available.
- TEST_CONFIG="phpunit.xml"
- TEST_CONFIG="phpunit-integration-legacy.xml"
- TEST_CONFIG="phpunit-integration-legacy.xml" DB="postgresql" DATABASE="pgsql://postgres@localhost/$DB_NAME"
- TEST_CONFIG="phpunit-integration-legacy.xml" DB="mysql" DATABASE="mysql://root@localhost/$DB_NAME"
- SOLR_VERSION="4.9.1" TEST_CONFIG="phpunit-integration-legacy-solr.xml"
- ELASTICSEARCH_VERSION="1.4.0" TEST_CONFIG="phpunit-integration-legacy-elasticsearch.xml"
matrix:
exclude:
# 5.4 run: unit test + integration test
- php: 5.4
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="postgresql" DATABASE="pgsql://postgres@localhost/$DB_NAME"
- php: 5.4
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="mysql" DATABASE="mysql://root@localhost/$DB_NAME"
- php: 5.4
env: SOLR_VERSION="4.9.1" TEST_CONFIG="phpunit-integration-legacy-solr.xml"
- php: 5.4
env: ELASTICSEARCH_VERSION="1.4.0" TEST_CONFIG="phpunit-integration-legacy-elasticsearch.xml"
# 5.5 run: unit test + integration test
- php: 5.5
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="postgresql" DATABASE="pgsql://postgres@localhost/$DB_NAME"
- php: 5.5
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="mysql" DATABASE="mysql://root@localhost/$DB_NAME"
- php: 5.5
env: SOLR_VERSION="4.9.1" TEST_CONFIG="phpunit-integration-legacy-solr.xml"
- php: 5.5
env: ELASTICSEARCH_VERSION="1.4.0" TEST_CONFIG="phpunit-integration-legacy-elasticsearch.xml"
# test only master (+ Pull requests)
branches:
only:
- master
# setup requirements for running unit tests
before_script:
# Disable xdebug to speed things up as we don't currently generate coverge on travis
- if [ $TRAVIS_PHP_VERSION != "hhvm" ]; then phpenv config-rm xdebug.ini ; fi
# Setup DB
- if [ $DB == "mysql" ]; then mysql -e "CREATE DATABASE IF NOT EXISTS $DB_NAME;" -uroot ; fi
- if [ $DB == "postgresql" ]; then psql -c "CREATE DATABASE $DB_NAME;" -U postgres ; psql -c "CREATE EXTENSION pgcrypto;" -U postgres $DB_NAME ; fi
# Setup github key to avoid api rate limit
- ./composer_install_github_key.sh
# Switch to another Symfony version if asked for
- if [ $SYMFONY_VERSION != "" ]; then composer require --no-update symfony/symfony=$SYMFONY_VERSION; fi;
# Install packages using composer
- composer install --dev --prefer-dist
# Setup Solr / Elastic search if asked for
- if [ "$TEST_CONFIG" == "phpunit-integration-legacy-elasticsearch.xml" ] ; then ./bin/.travis/init_elasticsearch.sh ; fi
- "if [ \"$TEST_CONFIG\" = \"phpunit-integration-legacy-solr.xml\" ] ; then curl -L https://raw.github.com/moliware/travis-solr/797595/travis-solr.sh | SOLR_CONFS=eZ/Publish/Core/Persistence/Solr/Content/Search/schema.xml bash ; fi"
# Detecting timezone issues by testing on random timezone
- TEST_TIMEZONES=("America/New_York" "Asia/Calcutta" "UTC")
- TEST_TIMEZONE=${TEST_TIMEZONES["`shuf -i 0-2 -n 1`"]}
- echo "$TEST_TIMEZONE"
# execute phpunit as the script command
script: "php -d date.timezone=$TEST_TIMEZONE -d memory_limit=-1 vendor/bin/phpunit -c $TEST_CONFIG"
# disable mail notifications
notifications:
email: false
# reduce depth (history) of git checkout
git:
depth: 30