Merge pull request #17853 from rodrigoprimo/fix/run-phpcs-only-once

Don't run PHPCS on the code coverage Travis job
This commit is contained in:
Claudio Sanches 2017-11-22 12:16:34 -02:00 committed by GitHub
commit 39e27196c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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/"

View File

@ -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