Skip to content

Commit 8ced3c6

Browse files
minor symfony#16222 [ci] Cache phpunit install (nicolas-grekas)
This PR was merged into the 2.3 branch. Discussion ---------- [ci] Cache phpunit install | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- e6d343a [ci] Cache phpunit install
2 parents 17499f5 + e6d343a commit 8ced3c6

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ addons:
77
- parallel
88
- language-pack-fr-base
99

10+
cache:
11+
directories:
12+
- .phpunit
13+
1014
matrix:
1115
include:
1216
- php: hhvm

appveyor.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,18 @@ install:
2020
- IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php)
2121
- cd c:\php
2222
- IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/releases/archives/php-5.3.3-nts-Win32-VC9-x86.zip
23-
- IF %PHP%==1 7z x php-5.3.3-nts-Win32-VC9-x86.zip -y > 7z.log
23+
- IF %PHP%==1 7z x php-5.3.3-nts-Win32-VC9-x86.zip -y >nul
2424
- IF %PHP%==1 appveyor DownloadFile http://nebm.ist.utl.pt/~glopes/misc/intl_win/ICU-51.2-dlls.zip
25-
- IF %PHP%==1 7z x ICU-51.2-dlls.zip -y > 7z.log
25+
- IF %PHP%==1 7z x ICU-51.2-dlls.zip -y >nul
26+
- IF %PHP%==1 del /Q *.zip
2627
- IF %PHP%==1 cd ext
2728
- 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
28-
- IF %PHP%==1 7z x php_intl-3.0.0-5.3-nts-vc9-x86.zip -y > 7z.log
29+
- IF %PHP%==1 7z x php_intl-3.0.0-5.3-nts-vc9-x86.zip -y >nul
2930
- 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
30-
- IF %PHP%==1 7z x php_apcu-4.0.7-5.3-nts-vc9-x86.zip -y > 7z.log
31+
- IF %PHP%==1 7z x php_apcu-4.0.7-5.3-nts-vc9-x86.zip -y >nul
3132
- 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
32-
- IF %PHP%==1 7z x php_memcache-3.0.8-5.3-nts-vc9-x86.zip -y > 7z.log
33+
- IF %PHP%==1 7z x php_memcache-3.0.8-5.3-nts-vc9-x86.zip -y >nul
34+
- IF %PHP%==1 del /Q *.zip
3335
- IF %PHP%==1 cd ..
3436
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
3537
- IF %PHP%==1 copy /Y php.ini-development php.ini-min

phpunit

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ if (!file_exists($COMPOSER = __DIR__.'/composer.phar')) {
2424
$PHP = ProcessUtils::escapeArgument($PHP);
2525
$COMPOSER = $PHP.' '.ProcessUtils::escapeArgument($COMPOSER);
2626

27-
if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__FILE__) !== @file_get_contents("$PHPUNIT_DIR/.md5") || (isset($argv[1]) && 'install' === $argv[1])) {
27+
if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__FILE__) !== @file_get_contents("$PHPUNIT_DIR/.md5")) {
2828
// Build a standalone phpunit without symfony/yaml
2929

3030
$oldPwd = getcwd();
3131
@mkdir($PHPUNIT_DIR);
3232
chdir($PHPUNIT_DIR);
3333
if (file_exists("phpunit-$PHPUNIT_VERSION")) {
34-
passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? 'del /S /F /Q %s & rmdir %1$s >nul 2>&1': 'rm -rf %s', "phpunit-$PHPUNIT_VERSION"));
34+
passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? '(del /S /F /Q %s & rmdir %1$s) >nul': 'rm -rf %s', "phpunit-$PHPUNIT_VERSION"));
3535
}
3636
if (extension_loaded('openssl') && ini_get('allow_url_fopen')) {
3737
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
5858
);
5959
chdir('..');
6060
if (file_exists('../src/Symfony/Bridge/PhpUnit') && `git diff --name-only HEAD^ -- ../src/Symfony/Bridge/PhpUnit`) {
61-
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")));
61+
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")));
6262
symlink(realpath('../src/Symfony/Bridge/PhpUnit'), "phpunit-$PHPUNIT_VERSION/vendor/symfony/phpunit-bridge");
6363
}
6464
file_put_contents('.md5', md5_file(__FILE__));

0 commit comments

Comments
 (0)