cakephp2-php8/.travis.yml

156 lines
4.6 KiB
YAML
Raw Permalink Normal View History

2012-03-18 23:29:26 +00:00
language: php
os: linux
2019-12-03 12:58:52 +00:00
dist: xenial
2012-03-18 23:29:26 +00:00
php:
2014-05-11 20:15:35 +00:00
- 5.6
2018-11-06 01:32:46 +00:00
- 7.3
2019-12-03 12:58:52 +00:00
- 7.4
2012-03-18 23:29:26 +00:00
env:
jobs:
2017-03-11 01:22:41 +00:00
- DB=mysql
global:
2019-12-03 12:58:52 +00:00
- PHPUNIT=5.7.19
2012-03-18 23:29:26 +00:00
services:
- memcached
2019-12-03 11:17:39 +00:00
- redis
- postgresql
- mysql
jobs:
fast_finish: true
2012-11-02 14:51:35 +00:00
include:
2019-12-03 12:58:52 +00:00
- php: 5.3
env: DB=mysql PHPUNIT=3.7.33
dist: precise
- php: 5.6
2019-12-03 12:58:52 +00:00
env: DB=pgsql PHPUNIT=3.7.33
2014-08-11 16:04:35 +00:00
- php: 7.0
2019-12-03 12:58:52 +00:00
env: DB=sqlite PHPUNIT=3.7.33
2012-11-02 14:51:35 +00:00
- php: 7.1
2019-12-03 12:58:52 +00:00
env: DB=sqlite
- php: 7.2
2019-12-03 12:58:52 +00:00
env: DB=pgsql
2018-11-06 01:32:46 +00:00
- php: 7.3
2019-12-03 12:58:52 +00:00
env: DB=sqlite
- php: 7.0
2019-12-03 12:58:52 +00:00
env: PHPCS=1
2012-03-18 23:29:26 +00:00
before_script:
2019-12-03 12:58:52 +00:00
- if [[ ${TRAVIS_PHP_VERSION:0:3} =~ ^7\.[234]$ ]] ; then pear config-set preferred_state snapshot && yes "" | pecl install mcrypt ; fi
- composer require "phpunit/phpunit=$PHPUNIT"
2017-07-27 02:58:09 +00:00
- echo "require_once 'vendors/autoload.php';" >> app/Config/bootstrap.php
2013-08-14 19:08:25 +00:00
- sudo locale-gen de_DE
- sudo locale-gen es_ES
2012-03-18 23:29:26 +00:00
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test2;'; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test3;'; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test2;' -U postgres -d cakephp_test; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi"
- chmod -R 777 ./app/tmp
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.3" ]] ; then pecl install timezonedb ; fi
- sh -c "if [ '$PHPCS' = '1' ]; then composer require 'cakephp/cakephp-codesniffer:1.*'; fi"
2017-07-27 03:20:03 +00:00
- sh -c "if [ '$PHPCS' = '1' ]; then vendors/bin/phpcs --config-set installed_paths vendors/cakephp/cakephp-codesniffer; fi"
2018-12-23 10:11:26 +00:00
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- if [[ ${TRAVIS_PHP_VERSION:0:1} == "7" ]] ; then echo "yes" | pecl install apcu-5.1.3 || true; fi
- if [[ ${TRAVIS_PHP_VERSION:0:1} == "5" ]] ; then echo "yes" | pecl install apcu-4.0.11 || true; fi
2016-05-07 06:42:37 +00:00
- echo -e "extension = apcu.so\napc.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
2012-11-02 14:51:35 +00:00
- phpenv rehash
2012-03-18 23:29:26 +00:00
- set +H
- echo "<?php
class DATABASE_CONFIG {
private \$identities = array(
'mysql' => array(
'datasource' => 'Database/Mysql',
2017-07-27 03:17:48 +00:00
'host' => '127.0.0.1',
2017-07-27 03:49:59 +00:00
'login' => 'root'
2012-03-18 23:29:26 +00:00
),
'pgsql' => array(
'datasource' => 'Database/Postgres',
'host' => '127.0.0.1',
'login' => 'postgres',
'database' => 'cakephp_test',
'schema' => array(
'default' => 'public',
'test' => 'public',
'test2' => 'test2',
'test_database_three' => 'test3'
)
),
'sqlite' => array(
'datasource' => 'Database/Sqlite',
'database' => array(
'default' => ':memory:',
'test' => ':memory:',
'test2' => '/tmp/cakephp_test2.db',
'test_database_three' => '/tmp/cakephp_test3.db'
),
)
);
public \$default = array(
'persistent' => false,
'host' => '',
'login' => '',
'password' => '',
'database' => 'cakephp_test',
'prefix' => ''
);
public \$test = array(
'persistent' => false,
'host' => '',
'login' => '',
'password' => '',
'database' => 'cakephp_test',
'prefix' => ''
);
public \$test2 = array(
'persistent' => false,
'host' => '',
'login' => '',
'password' => '',
'database' => 'cakephp_test2',
'prefix' => ''
);
public \$test_database_three = array(
'persistent' => false,
'host' => '',
'login' => '',
'password' => '',
'database' => 'cakephp_test3',
'prefix' => ''
);
public function __construct() {
\$db = 'mysql';
if (!empty(\$_SERVER['DB'])) {
\$db = \$_SERVER['DB'];
}
foreach (array('default', 'test', 'test2', 'test_database_three') as \$source) {
\$config = array_merge(\$this->{\$source}, \$this->identities[\$db]);
if (is_array(\$config['database'])) {
\$config['database'] = \$config['database'][\$source];
}
if (!empty(\$config['schema']) && is_array(\$config['schema'])) {
\$config['schema'] = \$config['schema'][\$source];
}
\$this->{\$source} = \$config;
}
}
}" > app/Config/database.php
2012-03-18 23:29:26 +00:00
script:
- sh -c "if [ '$PHPCS' != '1' ]; then ./lib/Cake/Console/cake test core AllTests --stderr --verbose; fi"
2017-07-27 03:20:03 +00:00
- sh -c "if [ '$PHPCS' = '1' ]; then vendors/bin/phpcs -p --extensions=php --standard=CakePHP ./lib/Cake; fi;"
2012-03-18 23:29:26 +00:00
notifications:
2013-06-05 10:05:15 +00:00
email: false