Skip to content

[travis] install from dist except for selected components #33654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ install:
- cd c:\projects\symfony
- IF NOT EXIST composer.phar (appveyor DownloadFile https://github.com/composer/composer/releases/download/1.9.0/composer.phar)
- php composer.phar self-update
- copy /Y .composer\* %APPDATA%\Composer\
- copy /Y .github\composer-config.json %APPDATA%\Composer\config.json
- php composer.phar global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
- php .github/build-packages.php "HEAD^" src\Symfony\Bridge\PhpUnit
- IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev)
Expand Down
7 changes: 0 additions & 7 deletions .composer/config.json

This file was deleted.

10 changes: 10 additions & 0 deletions .github/composer-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"config": {
"preferred-install": {
"symfony/form": "source",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the reason that those 3 components will be installed as source, and all other as dist?
what makes those 3 special?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh I guess the answer ist in the title of this PR:
#33637

"symfony/http-kernel": "source",
"symfony/validator": "source",
"*": "dist"
}
}
}
21 changes: 13 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ before_install:
mkdir /tmp/slapd
slapd -f src/Symfony/Component/Ldap/Tests/Fixtures/conf/slapd.conf -h ldap://localhost:3389 &
[ -d ~/.composer ] || mkdir ~/.composer
cp .composer/* ~/.composer/
cp .github/composer-config.json ~/.composer/config.json
export PHPUNIT=$(readlink -f ./phpunit)
export PHPUNIT_X="$PHPUNIT --exclude-group tty,benchmark,intl-data"
export COMPOSER_UP='composer update --no-progress --no-suggest --ansi'
Expand Down Expand Up @@ -95,7 +95,7 @@ before_install:

# tfold is a helper to create folded reports
tfold () {
local title="🐘 $PHP $1"
local title="🐘 $PHP $1 $FLIP"
local fold=$(echo $title | sed -r 's/[^-_A-Za-z0-9]+/./g')
shift
local id=$(printf %08x $(( RANDOM * RANDOM )))
Expand Down Expand Up @@ -202,7 +202,7 @@ install:
#SYMFONY_PHPUNIT_BRIDGE_PR=32886

if [[ $SYMFONY_PHPUNIT_BRIDGE_PR ]]; then
git fetch origin refs/pull/$SYMFONY_PHPUNIT_BRIDGE_PR/head
git fetch --depth=2 origin refs/pull/$SYMFONY_PHPUNIT_BRIDGE_PR/head
git rm -rq src/Symfony/Bridge/PhpUnit
git checkout -q FETCH_HEAD -- src/Symfony/Bridge/PhpUnit
SYMFONY_VERSION=$(cat src/Symfony/Bridge/PhpUnit/composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9.]*')
Expand Down Expand Up @@ -230,8 +230,9 @@ install:
- |
# For the master branch, when deps=high, the version before master is checked out and tested with the locally patched components
if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then
export FLIP='🙃'
SYMFONY_VERSION=$(git ls-remote --heads | grep -o '/[1-9].*' | tail -n 1 | sed s/.//) &&
git fetch origin $SYMFONY_VERSION &&
git fetch --depth=2 origin $SYMFONY_VERSION &&
git checkout -m FETCH_HEAD &&
COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
else
Expand Down Expand Up @@ -269,7 +270,7 @@ install:
set -e
export PHP=$1
if [[ $PHP != $TRAVIS_PHP_VERSION && $TRAVIS_PULL_REQUEST != false ]]; then
echo -e "\\n\\e[1;34mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"
echo -e "\\n\\e[33;1mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"
break
fi
phpenv global ${PHP/hhvm*/hhvm}
Expand All @@ -283,12 +284,12 @@ install:
tfold 'phpunit install' ./phpunit install
fi
if [[ $deps = high ]]; then
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && $COMPOSER_UP --prefer-source && $PHPUNIT_X$LEGACY'"
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && $COMPOSER_UP && $PHPUNIT_X$LEGACY'"
elif [[ $deps = low ]]; then
[[ -e ~/php-ext/composer-lowest.lock.tar ]] && tar -xf ~/php-ext/composer-lowest.lock.tar
tar -cf ~/php-ext/composer-lowest.lock.tar --files-from /dev/null
php .github/rm-invalid-lowest-lock-files.php $COMPONENTS
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && ([ -e composer.lock ] && ${COMPOSER_UP/update/install} || $COMPOSER_UP --prefer-lowest --prefer-stable --prefer-source) && $PHPUNIT_X'"
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && ([ -e composer.lock ] && ${COMPOSER_UP/update/install} || $COMPOSER_UP --prefer-lowest --prefer-stable) && $PHPUNIT_X'"
echo "$COMPONENTS" | xargs -n1 -I{} tar --append -f ~/php-ext/composer-lowest.lock.tar {}/composer.lock
elif [[ $PHP = hhvm* ]]; then
rm src/Symfony/Bridge/PhpUnit -Rf
Expand All @@ -304,4 +305,8 @@ install:
}

script:
- for PHP in $TRAVIS_PHP_VERSION $php_extra; do (run_tests $PHP); done
- for PHP in $TRAVIS_PHP_VERSION $php_extra; do
(run_tests $PHP) || X=1;
done

[[ ! $X ]] || (exit 1)