Pārlūkot izejas kodu

DevKit updates for 3.x branch (#3852)

Sonata CI 9 gadi atpakaļ
vecāks
revīzija
2e92f3edd4

+ 1 - 1
.editorconfig

@@ -13,7 +13,7 @@ indent_size = 4
 [*.{js,json,scss,css}]
 indent_size = 2
 
-[.travis-ci.yml]
+[.travis.yml]
 indent_size = 2
 
 [composer.json]

+ 3 - 15
.travis.yml

@@ -61,24 +61,12 @@ matrix:
     - env: SONATA_BLOCK=dev-master@dev
 
 before_install:
-  - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then mv "$HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini" /tmp; fi;
-  - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then echo "memory_limit=3072M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
-  - if [ "$TARGET" = 'test' ]; then composer self-update --stable; fi;
-  - if [ "$TARGET" = 'test' ]; then composer config --quiet --global github-oauth.github.com $GITHUB_OAUTH_TOKEN; fi;
-  - if [ "$TARGET" = 'test' ]; then sed --in-place "s/\"dev-master\":/\"dev-${TRAVIS_COMMIT}\":/" composer.json; fi;
-  - if [ "$TARGET" = 'test' -a "$SYMFONY" != "" ]; then composer require "symfony/symfony:$SYMFONY" --no-update; fi;
-  - if [ "$TARGET" = 'test' -a "$SONATA_CORE" != "" ]; then composer require "sonata-project/core-bundle:$SONATA_CORE" --no-update; fi;
-  - if [ "$TARGET" = 'test' -a "$SONATA_BLOCK" != "" ]; then composer require "sonata-project/block-bundle:$SONATA_BLOCK" --no-update; fi;
+  - if [ -x .travis/before_install_${TARGET}.sh ]; then .travis/before_install_${TARGET}.sh; fi;
 
 install:
-  - if [ "$TARGET" = 'test' ]; then mkdir "$HOME/bin"; fi;
-  - if [[ "$TARGET" = 'test' && "$TRAVIS_PHP_VERSION" < '5.6' ]]; then wget https://phar.phpunit.de/phpunit-old.phar --output-document="$HOME/bin/phpunit"; fi
-  - if [[ "$TARGET" = 'test' && ! "$TRAVIS_PHP_VERSION" < '5.6' ]]; then wget https://phar.phpunit.de/phpunit.phar --output-document="$HOME/bin/phpunit"; fi
-  - if [ "$TARGET" = 'test' ]; then chmod u+x "$HOME/bin/phpunit"; fi;
-  - if [ "$TARGET" = 'test' ]; then travis_wait 30 composer update --prefer-dist --no-interaction --prefer-stable $COMPOSER_FLAGS; fi;
-  - if [ "$TARGET" = 'docs' ]; then pip install -r Resources/doc/requirements.txt --user `whoami`; fi;
+  - if [ -x .travis/install_${TARGET}.sh ]; then .travis/install_${TARGET}.sh; fi;
 
 before_script:
-  - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then mv /tmp/xdebug.ini "$HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d"; fi;
+  - if [ -x .travis/before_script_${TARGET}.sh ]; then .travis/before_script_${TARGET}.sh; fi;
 
 script: make $TARGET

+ 16 - 0
.travis/before_install_test.sh

@@ -0,0 +1,16 @@
+#!/usr/bin/env sh
+set -ev
+
+if [ "${TRAVIS_PHP_VERSION}" != "hhvm" ]; then
+    mv "$HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini" /tmp
+    echo "memory_limit=3072M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
+fi
+
+# To be removed when following PR will be merged: https://github.com/travis-ci/travis-build/pull/718
+composer self-update --stable
+composer config --quiet --global github-oauth.github.com $GITHUB_OAUTH_TOKEN
+sed --in-place "s/\"dev-master\":/\"dev-${TRAVIS_COMMIT}\":/" composer.json
+
+if [ "$SYMFONY" != "" ]; then composer require "symfony/symfony:$SYMFONY" --no-update; fi;
+if [ "$SONATA_CORE" != "" ]; then composer require "sonata-project/core-bundle:$SONATA_CORE" --no-update; fi;
+if [ "$SONATA_BLOCK" != "" ]; then composer require "sonata-project/block-bundle:$SONATA_BLOCK" --no-update; fi;

+ 6 - 0
.travis/before_script_test.sh

@@ -0,0 +1,6 @@
+#!/usr/bin/env sh
+set -ev
+
+if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then
+    mv /tmp/xdebug.ini "$HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d"
+fi

+ 4 - 0
.travis/install_docs.sh

@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+set -ev
+
+pip install -r Resources/doc/requirements.txt --user $(whoami)

+ 15 - 0
.travis/install_test.sh

@@ -0,0 +1,15 @@
+#!/usr/bin/env sh
+set -ev
+
+mkdir --parents "${HOME}/bin"
+
+# PHPUnit install
+if [ ${TRAVIS_PHP_VERSION} '<' '5.6' ]; then
+    PHPUNIT_PHAR=phpunit-old.phar
+else
+    PHPUNIT_PHAR=phpunit.phar
+fi
+wget "https://phar.phpunit.de/${PHPUNIT_PHAR}" --output-document="${HOME}/bin/phpunit"
+chmod u+x "${HOME}/bin/phpunit"
+
+composer update --prefer-dist --no-interaction --prefer-stable ${COMPOSER_FLAGS}