forked from nlware/qdnatool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
44 lines (37 loc) · 1.71 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
language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
env:
- DB=mysql
matrix:
allow_failures:
- php: 5.4
- php: 5.5
- php: 5.6
include:
- php: 5.3
env:
- COVERALLS=1
- php: 5.3
env:
- PHPCS=1
before_script:
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then composer global require 'phpunit/phpunit=3.7.33'; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then ln -s ~/.composer/vendor/phpunit/phpunit/PHPUnit ./app/Vendor/PHPUnit; fi"
- sh -c "mysql -e 'CREATE DATABASE qdnatool_test;'"
- chmod -R 777 ./app/tmp
- composer install --dev --no-interaction --prefer-source
- sh -c "if [ '$COVERALLS' = '1' ]; then composer require --dev satooshi/php-coveralls:dev-master; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then pear channel-discover pear.cakephp.org; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then pear install --alldeps cakephp/CakePHP_CodeSniffer; fi"
- phpenv rehash
- echo -e "<?php\nclass DATABASE_CONFIG {\n\n\tpublic \$test = array(\n\t\t'datasource' => 'Database/Mysql',\n\t\t'database' => 'qdnatool_test',\n\t\t'host' => '0.0.0.0',\n\t\t'login' => 'travis',\n\t\t'persistent' => false,\n\t);\n}" > app/Config/database.php
script:
- sh -c "if [ '$PHPCS' = '1' ]; then phpcs -p --extensions=php --standard=CakePHP --ignore=Plugin --ignore=Vendor --ignore=webroot/js/ckeditor -n ./app; elif [ '$COVERALLS' = 1 ]; then cd ./app; ../vendors/bin/cake test app AllTests --stderr --coverage-clover ../build/logs/clover.xml --configuration ../phpunit.xml ; else cd ./app; ../vendors/bin/cake test app AllTests --stderr; fi"
after_success:
- sh -c "if [ '$COVERALLS' = '1' ]; then php vendors/bin/coveralls -c .coveralls.yml -v; fi"
notifications:
email: false