diff --git a/.travis.yml b/.travis.yml index 17a8f3738212c54f4b31e05bf373cb7dc3040d04..275ebfb2ee6274ad170b86151918b908d68bdc74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ php: - 7.0 env: global: + - COMPOSER_BIN_DIR=~/bin - INTEGRATION_SETS=2 matrix: - TEST_SUITE=unit @@ -22,9 +23,7 @@ env: - TEST_SUITE=static TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' cache: apt: true - directories: - - $HOME/.composer/cache - - $HOME/.cache/bin + directories: $HOME/.composer/cache matrix: exclude: - php: 5.6 @@ -32,5 +31,6 @@ matrix: - php: 7.0 env: TEST_SUITE=static before_install: ./dev/travis/before_install.sh +install: composer install --no-interaction --prefer-dist before_script: ./dev/travis/before_script.sh script: cd dev/tests/$TEST_SUITE && phpunit $TEST_FILTER diff --git a/dev/travis/before_install.sh b/dev/travis/before_install.sh index c24fd130ec48e89a2b8715167b53466cbf425a11..568cdb495b386767157dd3f9b463136cf12afc2b 100755 --- a/dev/travis/before_install.sh +++ b/dev/travis/before_install.sh @@ -4,15 +4,18 @@ # See COPYING.txt for license details. set -e -PATH="$HOME/.cache/bin:$PATH" +trap '>&2 echo Error: Command \`$BASH_COMMAND\` on line $LINENO failed with exit code $?' ERR -# install or update composer in casher dir -if [ "$CASHER_DIR" ]; then - if [ -x $HOME/.cache/bin/composer ]; then - $HOME/.cache/bin/composer self-update - else - mkdir -p $HOME/.cache/bin - curl --connect-timeout 30 -sS https://getcomposer.org/installer \ - | php -- --install-dir $HOME/.cache/bin/ --filename composer - fi -fi +# mock mail +sudo service postfix stop +echo # print a newline +smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 & +echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/sendmail.ini + +# disable xdebug and adjust memory limit +echo > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini +echo 'memory_limit = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini +phpenv rehash; + +# If env var is present, configure support for 3rd party builds which include private dependencies +test -n "$GITHUB_TOKEN" && composer config github-oauth.github.com "$GITHUB_TOKEN" || true diff --git a/dev/travis/before_script.sh b/dev/travis/before_script.sh index e8b5e142a84e48422896be4e371aaa7cb33d4cff..644d08d097e49e3ba5802f57b3dfa763451daaed 100755 --- a/dev/travis/before_script.sh +++ b/dev/travis/before_script.sh @@ -4,20 +4,9 @@ # See COPYING.txt for license details. set -e -PATH="$HOME/.cache/bin:$PATH" - trap '>&2 echo Error: Command \`$BASH_COMMAND\` on line $LINENO failed with exit code $?' ERR -# mock mail -sudo service postfix stop -echo # print a newline -smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 & -echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/sendmail.ini - -# disable xDebug -echo > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini - -# prepare for integration tests +# prepare for test suite case $TEST_SUITE in integration) cd dev/tests/integration @@ -81,14 +70,3 @@ case $TEST_SUITE in cd ../../.. ;; esac - -# change memory_limit for travis -echo 'memory_limit = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini -phpenv rehash; - -# install deps -export COMPOSER_BIN_DIR=~/bin -if [[ -n "$GITHUB_TOKEN" ]]; then - composer config github-oauth.github.com "$GITHUB_TOKEN" -fi -composer install --no-interaction --prefer-dist