From e671a2ad0234af792af051314a22dc0804ecbc94 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sat, 23 Sep 2017 18:55:47 +0200 Subject: [PATCH] [.travis.yml] Fix configuration to work with Ubuntu Trusty Travis CI upgraded the linux build environment from Ubuntu Precise to Ubuntu Trusty with Trusty becoming the default build environment as of August 2017: https://docs.travis-ci.com/user/reference/overview/ A bug in the configuration of the Ubuntu Trusty distro causes all builds except nightly to fail. The PHP include_path is set to include_path='.:/home/travis/.phpenv/versions/5.6.31/share/pear' instead of include_path='.:/home/travis/.phpenv/versions/5.6.31/lib/php/pear' which causes phpcs to fail because it cannot resolve import paths. This commit adds a hotfix to .travis.yml that circumvents the issue by overwriting the include_path during initialization. This hotfix should be removed once a solution is found. This bug is tracked via https://github.com/travis-ci/travis-ci/issues/8487 --- .travis.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 75010d8..7e84736 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: precise +dist: trusty language: php php: - '5.6' @@ -6,6 +6,20 @@ php: - hhvm - nightly +before_install: + # Circumvent a bug in current Travis CI builds using Ubuntu Trusty, where the + # include_path is wrong. + # + # Default is: + # - include_path='.:/home/travis/.phpenv/versions/5.6.31/share/pear' + # + # Should be: + # - include_path='.:/home/travis/.phpenv/versions/5.6.31/lib/php/pear' + # + # This applies to all builds except hhvm and nightly. Once the distro is fixed + # the following line can be removed + - if [[ ${TRAVIS_PHP_VERSION:0:1} == "5" || ${TRAVIS_PHP_VERSION:0:1} == "7" ]]; then echo "include_path='.:/home/travis/.phpenv/versions/$(phpenv version-name)/lib/php/pear'" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi + install: - pear channel-update pear.php.net - pear install PHP_CodeSniffer