-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
89 lines (81 loc) · 3.61 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
79
80
81
82
83
84
85
86
87
88
89
language: php
notifications:
slack: lararole:TikTmihmJXbga2cTjLRV9ME0
services:
- mysql
- postgresql
cache:
directories:
- $HOME/.composer/cache/files
matrix:
include:
- php: 7.2
env: COMPOSER_FLAGS="--prefer-lowest" DB_CONNECTION=pgsql DB_DATABASE=test DB_USERNAME=postgres DB_PASSWORD=
- php: 7.2
env: COMPOSER_FLAGS="--prefer-lowest" DB_CONNECTION=mysql MYSQL=8 DB_DATABASE=test DB_USERNAME=root DB_PASSWORD=
- php: 7.2
env: COMPOSER_FLAGS="--prefer-lowest" DB_CONNECTION=mysql DB_DATABASE=test DB_USERNAME=root DB_PASSWORD=
# - php: 7.2
# env: DB_CONNECTION=sqlsrv DB_DATABASE=test DB_USERNAME=sa DB_PASSWORD="Password!"
- php: 7.3
env: COMPOSER_FLAGS="--prefer-lowest" DB_CONNECTION=pgsql DB_DATABASE=test DB_USERNAME=postgres DB_PASSWORD=
- php: 7.3
env: COMPOSER_FLAGS="--prefer-lowest" DB_CONNECTION=mysql MYSQL=8 DB_DATABASE=test DB_USERNAME=root DB_PASSWORD=
- php: 7.3
env: COMPOSER_FLAGS="--prefer-lowest" DB_CONNECTION=mysql DB_DATABASE=test DB_USERNAME=root DB_PASSWORD=
# - php: 7.3
# env: DB_CONNECTION=sqlsrv DB_DATABASE=test DB_USERNAME=sa DB_PASSWORD="Password!"
- php: 7.4snapshot
env: COMPOSER_FLAGS="--prefer-lowest" DB_CONNECTION=pgsql DB_DATABASE=test DB_USERNAME=postgres DB_PASSWORD=
# - php: 7.4snapshot
# env: COMPOSER_FLAGS="--prefer-lowest" DB_CONNECTION=mysql MYSQL=8 DB_DATABASE=test DB_USERNAME=root DB_PASSWORD=
- php: 7.4snapshot
env: COMPOSER_FLAGS="--prefer-lowest" DB_CONNECTION=mysql DB_DATABASE=test DB_USERNAME=root DB_PASSWORD=
# - php: 7.4snapshot
# env: DB_CONNECTION=sqlsrv DB_DATABASE=test DB_USERNAME=sa DB_PASSWORD="Password!"
before_install:
- |
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
phpenv config-rm xdebug.ini
else
echo "xdebug.ini does not exist"
fi
- |
if [ $MYSQL == "8" ]; then
wget https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb
sudo apt-get update
sudo apt-get install -y --allow-unauthenticated -o Dpkg::Options::=--force-confnew mysql-server
sudo systemctl restart mysql
fi
- mysql -e 'CREATE DATABASE test;'
- psql -c 'create database test;' -U postgres
- |
if [ $DB_CONNECTION == "sqlsrv" ]; then
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list | sudo tee /etc/apt/sources.list.d/mssql-server-2017.list
sudo apt-get update
sudo apt-get install mssql-server
sudo MSSQL_SA_PASSWORD=Password! MSSQL_PID=developer /opt/mssql/bin/mssql-conf -n setup accept-eula
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install mssql-tools unixodbc-dev
pecl install pdo_sqlsrv
sudo /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Password! -Q "create database [test]"
fi
install:
- travis_retry composer self-update
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction
script:
- |
if [ $DB_CONNECTION == "mysql" ]; then
mysql --version
fi
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
after_script:
- |
if [ $COVERAGE == "yes" ]; then
travis_retry wget https://scrutinizer-ci.com/ocular.phar
travis_retry php ocular.phar code-coverage:upload --format=php-clover coverage.xml
fi