Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 526915a

Browse files
[travis] checkout previous major and test with patched components on deps=high
1 parent 27a4002 commit 526915a

File tree

3 files changed

+31
-9
lines changed

3 files changed

+31
-9
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ install:
4545
- cd c:\projects\symfony
4646
- IF NOT EXIST composer.phar (appveyor DownloadFile https://github.com/composer/composer/releases/download/1.9.0/composer.phar)
4747
- php composer.phar self-update
48-
- copy /Y .composer\* %APPDATA%\Composer\
48+
- copy /Y .github\composer-config.json %APPDATA%\Composer\config.json
4949
- php composer.phar global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
5050
- php .github/build-packages.php "HEAD^" src\Symfony\Bridge\PhpUnit src\Symfony\Contracts
5151
- IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev)
File renamed without changes.

.travis.yml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ before_install:
7272
fi
7373
slapd -f src/Symfony/Component/Ldap/Tests/Fixtures/conf/slapd.conf -h ldap://localhost:3389 &
7474
[ -d ~/.composer ] || mkdir ~/.composer
75-
cp .composer/* ~/.composer/
75+
cp .github/composer-config.json ~/.composer/config.json
7676
export PHPUNIT=$(readlink -f ./phpunit)
7777
export PHPUNIT_X="$PHPUNIT --exclude-group tty,benchmark,intl-data"
7878
export COMPOSER_UP='composer update --no-progress --no-suggest --ansi'
@@ -94,7 +94,7 @@ before_install:
9494
9595
# tfold is a helper to create folded reports
9696
tfold () {
97-
local title="🐘 $PHP $1"
97+
local title="🐘 $SWAP$PHP $1"
9898
local fold=$(echo $title | sed -r 's/[^-_A-Za-z0-9]+/./g')
9999
shift
100100
local id=$(printf %08x $(( RANDOM * RANDOM )))
@@ -192,7 +192,7 @@ install:
192192
#SYMFONY_PHPUNIT_BRIDGE_PR=32886
193193
194194
if [[ $SYMFONY_PHPUNIT_BRIDGE_PR ]]; then
195-
git fetch origin refs/pull/$SYMFONY_PHPUNIT_BRIDGE_PR/head
195+
git fetch --depth=2 origin refs/pull/$SYMFONY_PHPUNIT_BRIDGE_PR/head
196196
git rm -rq src/Symfony/Bridge/PhpUnit
197197
git checkout -q FETCH_HEAD -- src/Symfony/Bridge/PhpUnit
198198
SYMFONY_VERSION=$(cat src/Symfony/Bridge/PhpUnit/composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9.]*')
@@ -220,8 +220,9 @@ install:
220220
- |
221221
# For the master branch, when deps=high, the version before master is checked out and tested with the locally patched components
222222
if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then
223+
export SWAP='🙃'
223224
SYMFONY_VERSION=$(git ls-remote --heads | grep -o '/[1-9].*' | tail -n 1 | sed s/.//) &&
224-
git fetch origin $SYMFONY_VERSION &&
225+
git fetch --depth=2 origin $SYMFONY_VERSION &&
225226
git checkout -m FETCH_HEAD &&
226227
COMPONENTS=$(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
227228
else
@@ -257,15 +258,32 @@ install:
257258
set -e
258259
export PHP=$1
259260
if [[ $PHP != 7.4* && $PHP != $TRAVIS_PHP_VERSION && $TRAVIS_PULL_REQUEST != false ]]; then
260-
echo -e "\\n\\e[1;34mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"
261+
echo -e "\\n\\e[33;1mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"
261262
break
262263
fi
263264
phpenv global $PHP
264-
([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; composer config platform.ext-mongodb 1.6.0; composer require --dev --no-update mongodb/mongodb)
265+
([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; cp composer.json composer.bak; composer config platform.ext-mongodb 1.6.0; composer require --dev --no-update mongodb/mongodb)
265266
tfold 'composer update' $COMPOSER_UP
266267
tfold 'phpunit install' ./phpunit install
267268
if [[ $deps = high ]]; then
268-
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && $COMPOSER_UP --prefer-source && $PHPUNIT_X$LEGACY'"
269+
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && $COMPOSER_UP --prefer-source && $PHPUNIT_X$LEGACY'" || X=1
270+
(cd src/Symfony/Component/HttpFoundation; mv composer.bak composer.json)
271+
COMPONENTS=$(git diff --name-only src/ | grep composer.json || true)
272+
273+
if [[ $COMPONENTS && $LEGACY && $TRAVIS_PULL_REQUEST != false ]]; then
274+
export SWAP='🙃'
275+
COMPONENTS=$(echo "$COMPONENTS" | xargs dirname | sort)
276+
SYMFONY_VERSION=$(echo $SYMFONY_VERSION | awk '{print $1 - 1}')
277+
export SYMFONY_REQUIRE=">=$SYMFONY_VERSION"
278+
export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
279+
echo -e "\\n\\e[33;1mChecking out Symfony $SYMFONY_VERSION and running tests with patched components as deps\\e[0m"
280+
git fetch --depth=2 origin $SYMFONY_VERSION
281+
git checkout -m FETCH_HEAD
282+
(cd src/Symfony/Component/HttpFoundation; composer config platform.ext-mongodb 1.6.0; composer require --dev --no-update mongodb/mongodb)
283+
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && $COMPOSER_UP --prefer-source && $PHPUNIT_X$LEGACY'" || X=1
284+
fi
285+
286+
[[ ! $X ]] || (exit 1)
269287
elif [[ $deps = low ]]; then
270288
[[ -e ~/php-ext/composer-lowest.lock.tar ]] && tar -xf ~/php-ext/composer-lowest.lock.tar
271289
tar -cf ~/php-ext/composer-lowest.lock.tar --files-from /dev/null
@@ -294,4 +312,8 @@ install:
294312
}
295313
296314
script:
297-
- for PHP in $TRAVIS_PHP_VERSION $php_extra; do (run_tests $PHP); done
315+
- for PHP in $TRAVIS_PHP_VERSION $php_extra; do
316+
(run_tests $PHP) || X=1;
317+
done
318+
319+
[[ ! $X ]] || (exit 1)

0 commit comments

Comments
 (0)