travis: Update build script to test more reasonable configurations

PHP nightly recently got updated to dev-8.x, which is not supported
by any of the test scripts. This makes the test pretty useless and
doesn't help in any way.

Instead, the build script should focus on current versions of PHP,
starting from 5.6 to 7.3 (current stable release).

PHP 7.3 is a reasonable version to use for finding breaking changes
in the test scripts (phpunit especially warns about changes). These
tests can fail, of course.
This commit is contained in:
logmanoriginal 2019-03-20 19:27:27 +01:00
parent 88aae6fd95
commit 835af1faf1

View file

@ -4,41 +4,43 @@ language: php
install: install:
- composer global require dealerdirect/phpcodesniffer-composer-installer; - composer global require dealerdirect/phpcodesniffer-composer-installer;
- composer global require phpcompatibility/php-compatibility; - composer global require phpcompatibility/php-compatibility;
# Use PHPUnit 6 for unit tests (stable), requires PHP 7 - if [[ "$PHPUNIT" ]]; then
- if [[ $TRAVIS_PHP_VERSION == "7.0" ]]; then composer global require phpunit/phpunit ^$PHPUNIT;
composer global require phpunit/phpunit ^6;
fi
# Use latest PHPUnit on nightly to detect breaking changes
- if [[ $TRAVIS_PHP_VERSION == "nightly" ]]; then
composer global require phpunit/phpunit;
fi fi
script: script:
- phpenv rehash - phpenv rehash
# Run PHP_CodeSniffer on all versions # Run PHP_CodeSniffer on all versions
- ~/.config/composer/vendor/bin/phpcs . --standard=phpcs.xml --warning-severity=0 --extensions=php -p; - ~/.config/composer/vendor/bin/phpcs . --standard=phpcs.xml --warning-severity=0 --extensions=php -p;
# Check PHP compatibility for the lowest supported version # Check PHP compatibility for the lowest and highest supported version
- if [[ $TRAVIS_PHP_VERSION == "5.6" ]]; then - if [[ $TRAVIS_PHP_VERSION == "5.6" || $TRAVIS_PHP_VERSION == "7.3" ]]; then
~/.config/composer/vendor/bin/phpcs . --standard=phpcompatibility.xml --extensions=php -p; ~/.config/composer/vendor/bin/phpcs . --standard=phpcompatibility.xml --extensions=php -p;
fi fi
# Run unit tests (stable) # Run unit tests on highest major version
- if [[ $TRAVIS_PHP_VERSION == "7.0" ]]; then - if [[ ${TRAVIS_PHP_VERSION:0:1} == "7" ]]; then
phpunit --configuration=phpunit.xml --include-path=lib/; ~/.config/composer/vendor/bin/phpunit --configuration=phpunit.xml --include-path=lib/;
fi
# Run unit tests (latest/nightly)
# Check PHP compatibility for all versions, starting at the lowest supported version in order to detect breaking changes
- if [[ $TRAVIS_PHP_VERSION == "nightly" ]]; then
phpunit --configuration=phpunit.xml --include-path=lib/;
~/.config/composer/vendor/bin/phpcs . --standard=PHPCompatibility --extensions=php -p --runtime-set testVersion 5.6-;
fi fi
php:
- 7.3
env:
- PHPUNIT=6
- PHPUNIT=7
- PHPUNIT=8
matrix: matrix:
fast_finish: true fast_finish: true
include: include:
- php: 5.6 - php: 5.6
env: PHPUNIT=
- php: 7.0 - php: 7.0
- php: nightly - php: 7.1
- php: 7.2
allow_failures: allow_failures:
- php: nightly - php: 7.3
env: PHPUNIT=7
- php: 7.3
env: PHPUNIT=8