From e1e45382aadf2617b9a4abbdb1727f6706d9c566 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 31 Mar 2020 19:50:01 +0200 Subject: [PATCH] Travis: fix the build The Travis docs say that `$TRAVIS_BUILD_STAGE_NAME` is in "proper case" form: > TRAVIS_BUILD_STAGE_NAME: The build stage in capitalized form, e.g. Test or Deploy. If a build does not use build stages, this variable is empty (""). However, it looks like they made an (undocumented) change (probably a bug in their script handling) which means that the `$TRAVIS_BUILD_STAGE_NAME` name is now in the case as given, which in this case is _lowercase_. This means that some of the comparisons are failing and the wrong things are executed for certain builds. As I expect this to be a bug in Travis, I'm not changing the case for the comparisons at this time. Instead I'm fixing this by inline fixing the case of the variable for the comparisons. Refs: * https://docs.travis-ci.com/user/environment-variables#default-environment-variables (near the bottom of the list) --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 61020b4..c2b0404 100644 --- a/.travis.yml +++ b/.travis.yml @@ -109,7 +109,7 @@ before_install: # On stable PHPCS versions, allow for PHP deprecation notices. # Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore. - | - if [[ "$TRAVIS_BUILD_STAGE_NAME" != "Sniff" && $PHPCS_BRANCH != "dev-master" && "$PHPCS_VERSION" != "n/a" ]]; then + if [[ "${TRAVIS_BUILD_STAGE_NAME^}" != "Sniff" && $PHPCS_BRANCH != "dev-master" && "$PHPCS_VERSION" != "n/a" ]]; then echo 'error_reporting = E_ALL & ~E_DEPRECATED' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini fi @@ -120,7 +120,7 @@ install: composer require --no-update --no-scripts squizlabs/php_codesniffer:${PHPCS_VERSION} fi - | - if [[ "$TRAVIS_BUILD_STAGE_NAME" == "Sniff" || $PHPCS_VERSION == "n/a" ]]; then + if [[ "${TRAVIS_BUILD_STAGE_NAME^}" == "Sniff" || $PHPCS_VERSION == "n/a" ]]; then # The sniff stage doesn't run the unit tests, so no need for PHPUnit. # The build on nightly also doesn't run the tests (yet). composer remove --dev phpunit/phpunit --no-update --no-scripts