From e6d343a126dc69a16e5ff68f07a22851c11314fe Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 13 Oct 2015 10:49:36 +0200 Subject: [PATCH] [ci] Cache phpunit install --- .travis.yml | 4 ++++ appveyor.yml | 12 +++++++----- phpunit | 6 +++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index d6f3aa4934..91dcfa03fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,10 @@ addons: - parallel - language-pack-fr-base +cache: + directories: + - .phpunit + matrix: include: - php: hhvm diff --git a/appveyor.yml b/appveyor.yml index 82f97cd804..92b378b642 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,16 +20,18 @@ install: - IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php) - cd c:\php - IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/releases/archives/php-5.3.3-nts-Win32-VC9-x86.zip - - IF %PHP%==1 7z x php-5.3.3-nts-Win32-VC9-x86.zip -y > 7z.log + - IF %PHP%==1 7z x php-5.3.3-nts-Win32-VC9-x86.zip -y >nul - IF %PHP%==1 appveyor DownloadFile http://nebm.ist.utl.pt/~glopes/misc/intl_win/ICU-51.2-dlls.zip - - IF %PHP%==1 7z x ICU-51.2-dlls.zip -y > 7z.log + - IF %PHP%==1 7z x ICU-51.2-dlls.zip -y >nul + - IF %PHP%==1 del /Q *.zip - IF %PHP%==1 cd ext - IF %PHP%==1 appveyor DownloadFile http://nebm.ist.utl.pt/~glopes/misc/intl_win/php_intl-3.0.0-5.3-nts-vc9-x86.zip - - IF %PHP%==1 7z x php_intl-3.0.0-5.3-nts-vc9-x86.zip -y > 7z.log + - IF %PHP%==1 7z x php_intl-3.0.0-5.3-nts-vc9-x86.zip -y >nul - IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/apcu/4.0.7/php_apcu-4.0.7-5.3-nts-vc9-x86.zip - - IF %PHP%==1 7z x php_apcu-4.0.7-5.3-nts-vc9-x86.zip -y > 7z.log + - IF %PHP%==1 7z x php_apcu-4.0.7-5.3-nts-vc9-x86.zip -y >nul - IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/memcache/3.0.8/php_memcache-3.0.8-5.3-nts-vc9-x86.zip - - IF %PHP%==1 7z x php_memcache-3.0.8-5.3-nts-vc9-x86.zip -y > 7z.log + - IF %PHP%==1 7z x php_memcache-3.0.8-5.3-nts-vc9-x86.zip -y >nul + - IF %PHP%==1 del /Q *.zip - IF %PHP%==1 cd .. - IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat - IF %PHP%==1 copy /Y php.ini-development php.ini-min diff --git a/phpunit b/phpunit index c65498522c..c4b8634547 100755 --- a/phpunit +++ b/phpunit @@ -24,14 +24,14 @@ if (!file_exists($COMPOSER = __DIR__.'/composer.phar')) { $PHP = ProcessUtils::escapeArgument($PHP); $COMPOSER = $PHP.' '.ProcessUtils::escapeArgument($COMPOSER); -if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__FILE__) !== @file_get_contents("$PHPUNIT_DIR/.md5") || (isset($argv[1]) && 'install' === $argv[1])) { +if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__FILE__) !== @file_get_contents("$PHPUNIT_DIR/.md5")) { // Build a standalone phpunit without symfony/yaml $oldPwd = getcwd(); @mkdir($PHPUNIT_DIR); chdir($PHPUNIT_DIR); if (file_exists("phpunit-$PHPUNIT_VERSION")) { - passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? 'del /S /F /Q %s & rmdir %1$s >nul 2>&1': 'rm -rf %s', "phpunit-$PHPUNIT_VERSION")); + passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? '(del /S /F /Q %s & rmdir %1$s) >nul': 'rm -rf %s', "phpunit-$PHPUNIT_VERSION")); } if (extension_loaded('openssl') && ini_get('allow_url_fopen')) { stream_copy_to_stream(fopen("https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip", 'rb'), fopen("$PHPUNIT_VERSION.zip", 'wb')); @@ -58,7 +58,7 @@ EOPHP ); chdir('..'); if (file_exists('../src/Symfony/Bridge/PhpUnit') && `git diff --name-only HEAD^ -- ../src/Symfony/Bridge/PhpUnit`) { - passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? 'del /S /F /Q %s & rmdir %1$s >nul 2>&1': 'rm -rf %s', str_replace('/', DIRECTORY_SEPARATOR, "phpunit-$PHPUNIT_VERSION/vendor/symfony/phpunit-bridge"))); + passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? '(del /S /F /Q %s & rmdir %1$s) >nul': 'rm -rf %s', str_replace('/', DIRECTORY_SEPARATOR, "phpunit-$PHPUNIT_VERSION/vendor/symfony/phpunit-bridge"))); symlink(realpath('../src/Symfony/Bridge/PhpUnit'), "phpunit-$PHPUNIT_VERSION/vendor/symfony/phpunit-bridge"); } file_put_contents('.md5', md5_file(__FILE__));