From 6215437bdd6d6fc67ee167aea5e88324117be668 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 29 Dec 2015 16:09:05 +0100 Subject: [PATCH] [travis] use github token to fetch deps from ZIP files --- .composer-auth.json | 7 +++++++ .travis.yml | 7 ++++--- appveyor.yml | 4 +++- phpunit | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 .composer-auth.json diff --git a/.composer-auth.json b/.composer-auth.json new file mode 100644 index 0000000000..bf40540cc6 --- /dev/null +++ b/.composer-auth.json @@ -0,0 +1,7 @@ +{ + "github-oauth": { + "github.com": "PLEASE DO NOT USE THIS TOKEN IN YOUR OWN PROJECTS/FORKS", + "github.com": "This token is reserved for testing the symfony/symfony repository", + "github.com": "52270bad1071a099c8d24629f2db2b7f07db960d" + } +} diff --git a/.travis.yml b/.travis.yml index 2ada5b2ea5..46a2109589 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,7 @@ before_install: - if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then pecl install -f memcached-2.1.0 || echo "Let's continue without memcached extension"; fi; - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo extension = ldap.so >> $INI_FILE; fi; - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi; + - if [[ $TRAVIS_REPO_SLUG = symfony/symfony ]]; then cp .composer-auth.json ~/.composer/auth.json; fi; - if [[ $deps != skip ]]; then composer self-update; fi; - if [[ $deps != skip ]]; then ./phpunit install; fi; - export PHPUNIT=$(readlink -f ./phpunit) @@ -53,13 +54,13 @@ install: - if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; fi; - if [[ $deps = high && ${SYMFONY_VERSION%.*} != $(git show $(git ls-remote --heads | grep -FA1 /$SYMFONY_VERSION | tail -n 1):composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9]*' | head -n 1) ]]; then LEGACY=,legacy; fi; - export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev; - - if [[ ! $deps ]]; then composer --prefer-source install; else export SYMFONY_DEPRECATIONS_HELPER=weak; fi; + - if [[ ! $deps ]]; then composer update --prefer-dist; else export SYMFONY_DEPRECATIONS_HELPER=weak; fi; - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi; script: - if [[ ! $deps ]]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi; - if [[ ! $deps ]]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi; - if [[ ! $deps && $TRAVIS_PHP_VERSION = ${MIN_PHP%.*} ]]; then echo -e "1\\n0" | parallel --gnu --timeout 60 'echo -e "\\nPHP --enable-sigchild enhanced={}" && ENHANCE_SIGCHLD={} php-$MIN_PHP/sapi/cli/php .phpunit/phpunit-4.8/phpunit --colors=always src/Symfony/Component/Process/'; fi; - - if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer --prefer-source update; $PHPUNIT --exclude-group tty,benchmark,intl-data'$LEGACY; fi; - - if [[ $deps = low ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi; + - if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --prefer-dist; $PHPUNIT --exclude-group tty,benchmark,intl-data'$LEGACY; fi; + - if [[ $deps = low ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --prefer-dist --prefer-lowest --prefer-stable; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi; - if [[ $deps = skip ]]; then echo This matrix line is skipped for pull requests.; fi; diff --git a/appveyor.yml b/appveyor.yml index 9ae51aca0a..61e8b56353 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -49,9 +49,11 @@ install: - appveyor DownloadFile https://getcomposer.org/composer.phar - copy /Y php.ini-max php.ini - cd c:\projects\symfony + - mkdir %APPDATA%\Composer + - IF %APPVEYOR_REPO_NAME%==symfony/symfony copy /Y .composer-auth.json %APPDATA%\Composer\auth.json - php phpunit install - IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev) - - composer update --prefer-source --no-progress --ansi + - composer update --prefer-dist --no-progress --ansi test_script: - cd c:\projects\symfony diff --git a/phpunit b/phpunit index 146ab9d376..0517719add 100755 --- a/phpunit +++ b/phpunit @@ -53,7 +53,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__ chdir("phpunit-$PHPUNIT_VERSION"); passthru("$COMPOSER remove --no-update symfony/yaml"); passthru("$COMPOSER require --dev --no-update symfony/phpunit-bridge \">=2.8@dev\""); - passthru("$COMPOSER install --prefer-source --no-progress --ansi"); + passthru("$COMPOSER install --prefer-dist --no-progress --ansi"); file_put_contents('phpunit', <<