diff --git a/.travis.yml b/.travis.yml index 7a7b3222baf..688611b657a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,35 +8,20 @@ php: services: - mongodb + - memcached before_install: - - ./unit-tests/ci/install_memcached.sh - - ./unit-tests/ci/install_apc.sh - - ./unit-tests/ci/install_mongo.sh + - phpenv config-add ./unit-tests/ci/memcache.ini + - phpenv config-add ./unit-tests/ci/mongo.ini + - ./unit-tests/ci/install_prereqs.sh + - ./unit-tests/ci/setup_dbs.sh before_script: - - git submodule init - - git submodule update - - cd php-tests/library/Mustache - - git checkout master - - cd ../../.. - - cd php-tests/library/Twig - - git checkout master - - cd ../../.. - - mkdir -p unit-tests/engines - - cd unit-tests/engines/ - - git clone https://github.com/bobthecow/mustache.php.git - - git clone git://github.com/fabpot/Twig.git - - cd ../../ext - - export CFLAGS="-g3 -O1 -fno-delete-null-pointer-checks" - - phpize && ./configure --enable-phalcon && make && sudo make install - - echo "extension=phalcon.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` - - cd .. - - mysql -uroot -e 'create database phalcon_test charset=utf8 collate=utf8_unicode_ci;' - - mysql -uroot phalcon_test < unit-tests/schemas/mysql/phalcon_test.sql - - psql -c 'create database phalcon_test;' -U postgres - - psql -U postgres phalcon_test -q -f unit-tests/schemas/postgresql/phalcon_test.sql - - sqlite3 /tmp/phalcon_test.sqlite < unit-tests/schemas/sqlite/phalcon_test.sql + - git submodule --quiet update --init --recursive + - (cd php-tests/library/Mustache; git checkout master ) + - (cd php-tests/library/Twig; git checkout master ) + - (cd unit-tests/engines/; git clone -q git://github.com/bobthecow/mustache.php.git & git clone -q git://github.com/fabpot/Twig.git & wait) + - (cd ext; export CFLAGS="-g3 -O1 -fno-delete-null-pointer-checks -Wall"; phpize && ./configure --enable-phalcon && make -j2 && sudo make install && phpenv config-add ../unit-tests/ci/phalcon.ini) - ulimit -c unlimited || true script: diff --git a/unit-tests/ci/apc.ini b/unit-tests/ci/apc.ini new file mode 100644 index 00000000000..1dccdd6f27a --- /dev/null +++ b/unit-tests/ci/apc.ini @@ -0,0 +1,2 @@ +extension=apc.so +apc.enable_cli=On diff --git a/unit-tests/ci/apcu.ini b/unit-tests/ci/apcu.ini new file mode 100644 index 00000000000..05d393faf99 --- /dev/null +++ b/unit-tests/ci/apcu.ini @@ -0,0 +1 @@ +apc.enable_cli=On diff --git a/unit-tests/ci/igbinary.ini b/unit-tests/ci/igbinary.ini new file mode 100644 index 00000000000..a09dab71667 --- /dev/null +++ b/unit-tests/ci/igbinary.ini @@ -0,0 +1,3 @@ +extension=igbinary.so +igbinary.compact_strings=Off + diff --git a/unit-tests/ci/install_apc.sh b/unit-tests/ci/install_apc.sh deleted file mode 100755 index f32db7128cd..00000000000 --- a/unit-tests/ci/install_apc.sh +++ /dev/null @@ -1,20 +0,0 @@ -#! /bin/sh - -if [ "$(php -r 'echo substr(PHP_VERSION, 0, 3);')" = "5.3" ]; then - wget -q http://pecl.php.net/get/apc-3.1.9.tgz - tar -xzf apc-3.1.9.tgz - ( cd APC-3.1.9 && phpize && ./configure --enable-apc && make && sudo make install ) - echo "extension=apc.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` -elif [ "$(php -r 'echo substr(PHP_VERSION, 0, 3);')" = "5.5" ]; then - wget -q http://pecl.php.net/get/apcu-4.0.1.tgz - tar xzf apcu-4.0.1.tgz - ( cd apcu-4.0.1 && phpize && ./configure && make && sudo make install ) - echo "extension=apcu.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` -else - wget -q http://pecl.php.net/get/apc-3.1.13.tgz - tar -xzf apc-3.1.13.tgz - ( cd APC-3.1.13 && phpize && ./configure --enable-apc && make && sudo make install ) - echo "extension=apc.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` -fi - -echo "apc.enable_cli = On" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` diff --git a/unit-tests/ci/install_memcached.sh b/unit-tests/ci/install_memcached.sh deleted file mode 100755 index b32afa4a2a1..00000000000 --- a/unit-tests/ci/install_memcached.sh +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/sh - -if [ "$(php -r 'echo substr(PHP_VERSION, 0, 3);')" = "5.3" ]; then - wget -q http://pecl.php.net/get/memcache-2.2.7.tgz - tar -xzf memcache-2.2.7.tgz - ( cd memcache-2.2.7 && phpize && ./configure --enable-memcache && make && sudo make install ) -else - wget -q http://pecl.php.net/get/memcache-3.0.7.tgz - tar -xzf memcache-3.0.7.tgz - ( cd memcache-3.0.7 && phpize && ./configure --enable-memcache && make && sudo make install ) -fi - -echo "extension=memcache.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` diff --git a/unit-tests/ci/install_mongo.sh b/unit-tests/ci/install_mongo.sh deleted file mode 100755 index 77e00afad88..00000000000 --- a/unit-tests/ci/install_mongo.sh +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/sh - -wget -q http://pecl.php.net/get/mongo-1.4.1.tgz -tar -xzf mongo-1.4.1.tgz -( cd mongo-1.4.1 && phpize && ./configure --enable-mongo && make && sudo make install ) - -echo "extension=mongo.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` diff --git a/unit-tests/ci/install_prereqs.sh b/unit-tests/ci/install_prereqs.sh new file mode 100755 index 00000000000..ae9695666ee --- /dev/null +++ b/unit-tests/ci/install_prereqs.sh @@ -0,0 +1,15 @@ +#! /bin/sh + +DIR=$(readlink -enq $(dirname $0)) + +if [ "$(php -r 'echo substr(PHP_VERSION, 0, 3);')" = "5.5" ]; then + ( pecl install apcu < /dev/null || ( pecl config-set preferred_state beta; pecl install apcu < /dev/null ) && phpenv config-add "$DIR/apcu.ini" ) & +else + phpenv config-add "$DIR/apc.ini" +fi + +pecl install igbinary < /dev/null && phpenv config-add $(DIR)/igbinary.ini & + +phpenv config-add $(DIR)/memcache.ini +phpenv config-add $(DIR)/mongo.ini +wait diff --git a/unit-tests/ci/memcache.ini b/unit-tests/ci/memcache.ini new file mode 100644 index 00000000000..587455f3630 --- /dev/null +++ b/unit-tests/ci/memcache.ini @@ -0,0 +1 @@ +extension=memcache.so diff --git a/unit-tests/ci/mongo.ini b/unit-tests/ci/mongo.ini new file mode 100644 index 00000000000..5998f92647a --- /dev/null +++ b/unit-tests/ci/mongo.ini @@ -0,0 +1 @@ +extension=mongo.so diff --git a/unit-tests/ci/phalcon.ini b/unit-tests/ci/phalcon.ini new file mode 100644 index 00000000000..d611c536596 --- /dev/null +++ b/unit-tests/ci/phalcon.ini @@ -0,0 +1 @@ +extension=phalcon.so diff --git a/unit-tests/ci/setup_dbs.sh b/unit-tests/ci/setup_dbs.sh new file mode 100755 index 00000000000..0e17a7af683 --- /dev/null +++ b/unit-tests/ci/setup_dbs.sh @@ -0,0 +1,8 @@ +#! /bin/sh + +DIR=$(readlink -enq $(dirname $0)) + +(mysql -uroot -e 'create database phalcon_test charset=utf8 collate=utf8_unicode_ci;' && mysql -uroot phalcon_test < "$DIR/../schemas/mysql/phalcon_test.sql") & +(psql -c 'create database phalcon_test;' -U postgres && psql -U postgres phalcon_test -q -f "$DIR/../schemas/postgresql/phalcon_test.sql") & +sqlite3 /tmp/phalcon_test.sqlite < "$DIR/../schemas/sqlite/phalcon_test.sql" +wait