-
Notifications
You must be signed in to change notification settings - Fork 242
/
.travis.yml
57 lines (47 loc) · 1.51 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
language: php
services:
- mysql
- postgresql
cache:
directories:
- $HOME/.composer/cache/files
branches:
only:
- master
# Match year version branches
- /^20\d{2}.\d{2}$/
# Match semantic version branches (in case of legacy, only used for 5.4 ee release, kept to serve as an example)
- /^\d.\d$/
env:
global:
- DB_NAME="testdb"
# Aim to run tests on all versions of php, make sure each db is run at least once
matrix:
include:
- php: 5.6
env: DB="postgresql" DB_USER="postgres"
- php: 5.6
env: DB="mysql" DB_USER="root"
- php: 7.0
env: DB="postgresql" DB_USER="postgres"
- php: 7.1
env: DB="mysql" DB_USER="root"
- php: 7.2
env: DB="postgresql" DB_USER="postgres"
- php: 7.3
env: DB="mysql" DB_USER="root"
before_script:
- if [ $DB == "mysql" ]; then mysql -e "CREATE DATABASE IF NOT EXISTS $DB_NAME;" -u$DB_USER ; fi
- if [ $DB == "postgresql" ]; then psql -c "CREATE DATABASE $DB_NAME;" -U $DB_USER ; psql -c "CREATE EXTENSION pgcrypto;" -U $DB_USER $DB_NAME ; fi
- composer install --prefer-source
- php bin/php/ezpgenerateautoloads.php -s -e
# 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"
script:
- php -d date.timezone=$TEST_TIMEZONE tests/runtests.php --dsn "$DB://${DB_USER}@127.0.0.1/$DB_NAME" tests extension/ezoe
notification:
email: false
git:
depth: 30