language: php services: - mysql cache: directories: - $HOME/.composer/cache # Explicitly test against supported versions of PHP # # Reference: https://www.php.net/supported-versions.php php: - 7.4snapshot - 7.3 - 7.2 # Test against the latest version of WordPress and one version back. env: - WP_VERSION=latest - WP_VERSION=5.5 # Customize the build matrix. matrix: fast_finish: true include: # Run PHP_CodeSniffer - name: Coding standards php: 7.4 env: WP_VERSION=latest WP_TRAVISCI=phpunit # Canary for our oldest-supported version #- name: Legacy # php: 5.6 # env: WP_VERSION=4.9 # Nightly versions of PHP and WordPress. - name: Bleeding edge php: 7.4snapshot env: WP_VERSION=trunk # Jobs that are permitted to fail without breaking the build allow_failures: - name: Bleeding edge before_install: - export PATH="$HOME/.composer/vendor/bin:$PATH" # Unless we need XDebug, disable it for improved performance. - phpenv config-rm xdebug.ini || return 0 install: # Install our Composer dependencies - composer install --prefer-dist --no-interaction # Install an older version of PHPUnit if we're still running PHP 5.6. - | if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then wget -O ./vendor/bin/phpunit https://phar.phpunit.de/phpunit-5.phar chmod +x ./vendor/bin/phpunit fi # Install the WordPress core test suite - bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION script: # If we've set the $WP_TRAVISCI variable to run PHPCS, do that instead # of running PHPUnit. - | if [[ "$WP_TRAVISCI" == "phpcs" ]]; then ./vendor/bin/phpcs else # Execute the test suite ./vendor/bin/phpunit # Optionally run the tests again in a multisite environment #WP_MULTISITE=1 ./vendor/bin/phpunit fi