Skip to content

Commit dc18ed4

Browse files
committed
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)
1 parent fd7ec4c commit dc18ed4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ before_install:
108108
# On stable PHPCS versions, allow for PHP deprecation notices.
109109
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
110110
- |
111-
if [[ "$TRAVIS_BUILD_STAGE_NAME" != "Sniff" && "$PHPCS_VERSION" != "dev-master" && "$PHPCS_VERSION" != "n/a" ]]; then
111+
if [[ "${TRAVIS_BUILD_STAGE_NAME^}" != "Sniff" && "$PHPCS_VERSION" != "dev-master" && "$PHPCS_VERSION" != "n/a" ]]; then
112112
echo 'error_reporting = E_ALL & ~E_DEPRECATED' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
113113
fi
114114
115115
- export XMLLINT_INDENT=" "
116116

117117
# Set up test environment using Composer.
118118
- |
119-
if [[ "$TRAVIS_BUILD_STAGE_NAME" != "Sniff" ]]; then
119+
if [[ "${TRAVIS_BUILD_STAGE_NAME^}" != "Sniff" ]]; then
120120
# Remove the PHPCSDevCS dependency as it has different PHPCS requirements and would block installs.
121121
composer remove --dev phpcsstandards/phpcsdevcs --no-update --no-scripts
122122
fi
@@ -125,7 +125,7 @@ before_install:
125125
composer require --no-update --no-scripts squizlabs/php_codesniffer:${PHPCS_VERSION}
126126
fi
127127
- |
128-
if [[ "$TRAVIS_BUILD_STAGE_NAME" == "Sniff" || $PHPCS_VERSION == "n/a" ]]; then
128+
if [[ "${TRAVIS_BUILD_STAGE_NAME^}" == "Sniff" || $PHPCS_VERSION == "n/a" ]]; then
129129
# The sniff stage doesn't run the unit tests, so no need for PHPUnit.
130130
composer remove --dev phpunit/phpunit --no-update --no-scripts
131131
elif [[ "$PHPCS_VERSION" < "3.1.0" ]]; then

0 commit comments

Comments
 (0)