diff --git a/.travis.yml b/.travis.yml index 9bfdf909036..4eed346afbe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,6 @@ sudo: false php: - 5.6 - 7.0 - - 7.1 env: - WP_VERSION=latest WP_MULTISITE=0 @@ -20,6 +19,8 @@ matrix: dist: precise - php: 5.2 dist: precise + - php: 7.1 + env: WP_VERSION=latest WP_MULTISITE=0 RUN_PHPCS=1 - php: 7.1 env: WP_VERSION=latest WP_MULTISITE=0 RUN_CODE_COVERAGE=1 allow_failures: @@ -27,7 +28,6 @@ matrix: before_script: - export PATH="$HOME/.composer/vendor/bin:$PATH" - - if [[ $TRAVIS_PHP_VERSION == '7.1' ]]; then composer install; fi - bash tests/bin/install.sh woocommerce_test root '' localhost $WP_VERSION - bash tests/bin/travis.sh before diff --git a/tests/bin/phpcs.sh b/tests/bin/phpcs.sh index 5a3a973cd6e..c8d25115cec 100755 --- a/tests/bin/phpcs.sh +++ b/tests/bin/phpcs.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if [[ $TRAVIS_PHP_VERSION == '7.1' ]]; then +if [[ ${RUN_PHPCS} == 1 ]]; then CHANGED_FILES=`git diff --name-only --diff-filter=ACMR $TRAVIS_COMMIT_RANGE | grep \\\\.php | awk '{print}' ORS=' '` IGNORE="tests/cli/,apigen/,includes/gateways/simplify-commerce/includes/,includes/libraries/,includes/api/legacy/" diff --git a/tests/bin/travis.sh b/tests/bin/travis.sh index 46de86aabb0..bd7e3fda61f 100755 --- a/tests/bin/travis.sh +++ b/tests/bin/travis.sh @@ -15,6 +15,10 @@ if [ $1 == 'before' ]; then composer global require "phpunit/phpunit=6.2.*" fi + if [[ ${RUN_PHPCS} == 1 ]]; then + composer install + fi + # Remove Xdebug from PHP runtime for all PHP version except 7.1 to speed up builds. # We need Xdebug enabled in the PHP 7.1 build job as it is used to generate code coverage. if [[ ${RUN_CODE_COVERAGE} != 1 ]]; then