-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
55 lines (46 loc) · 1.43 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
services:
- postgresql
- mysql
addons:
postgresql: 9.4
apt:
sources:
- mysql-5.7-trusty
packages:
- mysql-server
language: php
php:
- 7.1
- 7.2
# faster builds on new travis setup not using sudo
sudo: false
# cache vendor dirs
cache:
directories:
- vendor
- $HOME/.composer/cache
install:
- travis_retry composer self-update && composer --version
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- travis_retry composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader
- mkdir -p build/logs
before_script:
- sudo chmod a+rX /home /home/travis /home/travis/build /home/travis/build/Tigrov /home/travis/build/Tigrov/yii2-country
- echo -e "[server]\nsecure-file-priv=" | sudo tee -a /etc/mysql/my.cnf
- sudo service mysql restart
- mysql -e 'CREATE DATABASE `yiitest`;'
- psql -U postgres -c 'CREATE DATABASE yiitest;'
- |
if [ $TRAVIS_PHP_VERSION != '5.6' ] && [ $TRAVIS_PHP_VERSION != '7.0' ]; then
travis_retry composer require rinvex/countries ~5.0
fi
script:
- phpunit
- echo '<?php return ["components" => ["db" => ["dsn" => "mysql:host=127.0.0.1;dbname=yiitest", "username" => "root"]]];' >> 'tests/data/config.local.php'
- phpunit
after_script:
- |
if [ $TRAVIS_PHP_VERSION = '7.1' ]; then
travis_retry wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar
php php-coveralls.phar -v
fi