Skip to content

Commit 18fe999

Browse files
committed
minor symfony#15322 [travis] Fix deps=high/low jobs (nicolas-grekas)
This PR was merged into the 2.3 branch. Discussion ---------- [travis] Fix deps=high/low jobs | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#15230 | License | MIT | Doc PR | - Commits ------- 1c9b433 [travis] Fix deps=high jobs
2 parents 0da0f9e + 1c9b433 commit 18fe999

File tree

6 files changed

+56
-35
lines changed

6 files changed

+56
-35
lines changed

.gitignore

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
.php_cs.cache
2-
autoload.php
1+
vendor/
32
composer.lock
4-
composer.phar
5-
package*.tar
6-
packages.json
73
phpunit.xml
8-
/vendor/
4+
.php_cs.cache
5+
composer.phar
6+
package.tar
7+
/packages.json

.travis.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
if (4 > $_SERVER['argc']) {
4+
echo "Usage: commit-range branch dir1 dir2 ... dirN\n";
5+
exit(1);
6+
}
7+
8+
$dirs = $_SERVER['argv'];
9+
array_shift($dirs);
10+
$range = array_shift($dirs);
11+
$branch = array_shift($dirs);
12+
13+
$packages = array();
14+
$flags = PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0;
15+
16+
foreach ($dirs as $dir) {
17+
if (!`git diff --name-only $range -- $dir`) {
18+
continue;
19+
}
20+
echo "$dir\n";
21+
22+
$package = json_decode(file_get_contents($dir.'/composer.json'));
23+
24+
$package->repositories = array(array(
25+
'type' => 'composer',
26+
'url' => 'file://'.__DIR__.'/',
27+
));
28+
file_put_contents($dir.'/composer.json', json_encode($package, $flags));
29+
passthru("cd $dir && tar -cf package.tar --exclude='package.tar' *");
30+
31+
$package->version = $branch.'.x-dev';
32+
$package->dist['type'] = 'tar';
33+
$package->dist['url'] = 'file://'.__DIR__."/$dir/package.tar";
34+
35+
$packages[$package->name][$package->version] = $package;
36+
37+
$versions = file_get_contents('https://packagist.org/packages/'.$package->name.'.json');
38+
$versions = json_decode($versions);
39+
40+
foreach ($versions->package->versions as $version => $package) {
41+
$packages[$package->name] += array($version => $package);
42+
}
43+
}
44+
45+
file_put_contents('packages.json', json_encode(compact('packages'), $flags));

.travis.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ env:
3333

3434
before_install:
3535
- composer self-update
36+
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
3637
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini; fi;
3738
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
3839
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] && [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
@@ -44,7 +45,7 @@ before_install:
4445
install:
4546
- if [ "$deps" = "no" ]; then composer --prefer-source install; fi;
4647
- components=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n')
47-
- if [ "$deps" != "no" ]; then sh .travis.sh $TRAVIS_BRANCH $components; fi;
48+
- if [ "$deps" != "no" ]; then php .travis.php $TRAVIS_COMMIT_RANGE $TRAVIS_BRANCH $components; fi;
4849

4950
script:
5051
- if [ "$deps" = "no" ]; then echo "$components" | parallel --gnu --keep-order 'echo -e "\\nRunning {} tests"; phpunit --exclude-group tty,benchmark,intl-data {} || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi;

src/Symfony/Bridge/Twig/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"require-dev": {
2323
"symfony/phpunit-bridge": "~2.7",
2424
"symfony/finder": "~2.3",
25-
"symfony/form": "~2.3.5",
25+
"symfony/form": "~2.3.31",
2626
"symfony/http-kernel": "~2.3",
2727
"symfony/intl": "~2.3",
2828
"symfony/routing": "~2.2",

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
],
1818
"require": {
1919
"php": ">=5.3.3",
20-
"symfony/dependency-injection" : "~2.3",
21-
"symfony/config" : "~2.3,>=2.3.12",
20+
"symfony/dependency-injection": "~2.3",
21+
"symfony/config": "~2.3,>=2.3.12",
2222
"symfony/event-dispatcher": "~2.1",
2323
"symfony/http-foundation": "~2.3,>=2.3.19",
2424
"symfony/http-kernel": "~2.3,>=2.3.22",
@@ -38,7 +38,7 @@
3838
"symfony/finder": "~2.0,>=2.0.5",
3939
"symfony/intl": "~2.3",
4040
"symfony/security": "~2.3",
41-
"symfony/form": "~2.3.0,>=2.3.5",
41+
"symfony/form": "~2.3.31",
4242
"symfony/class-loader": "~2.1",
4343
"symfony/process": "~2.0,>=2.0.5",
4444
"symfony/validator": "~2.1",

0 commit comments

Comments
 (0)