Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis: run CS in separate workflow & other minor tweaks #16903

Merged
merged 4 commits into from Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 14 additions & 33 deletions .travis.yml
Expand Up @@ -25,7 +25,17 @@ jobs:
fast_finish: true
include:
- php: 7.2
env: PHPCS=1 CHECKJS=1 SECURITY=1 TRAVIS_NODE_VERSION=lts/* AUTO_CHECKOUT_MONOREPO_BRANCH=1
env: CHECKJS=1 SECURITY=1 TRAVIS_NODE_VERSION=lts/* AUTO_CHECKOUT_MONOREPO_BRANCH=1
- php: 7.4
name: 'PHP 7.4: Check CS'
before_install: skip
before_script: skip
install:
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
- travis_retry composer install --no-interaction
script:
- composer check-cs-threshold
after_script: skip
- php: 7.3.24
env: WP_VERSION=latest WP_MULTISITE=1 COVERAGE=1
- php: 5.6
Expand Down Expand Up @@ -117,7 +127,6 @@ cache:
before_install:
- export SECURITYCHECK_DIR=/tmp/security-checker
- if [[ -z "$CC_TEST_REPORTER_ID" ]]; then COVERAGE="0"; fi
- if [[ -d "premium" ]]; then IS_PREMIUM=1; fi
- if [[ "$COVERAGE" != "1" ]]; then phpenv config-rm xdebug.ini || echo 'No xdebug config.'; fi
- |
if [[ "$CHECKJS" == "1" ]]; then
Expand Down Expand Up @@ -146,25 +155,12 @@ install:
fi
- |
if [[ ${TRAVIS_PHP_VERSION:0:1} == "8" || $TRAVIS_PHP_VERSION == "nightly" ]]; then
if [[ "$IS_PREMIUM" == "1" ]]; then
cd premium
travis_retry composer install --no-interaction --ignore-platform-reqs --no-scripts --no-suggest
cd -
else
travis_retry composer install --no-interaction --ignore-platform-reqs --no-scripts --no-suggest
fi
elif [[ "$PHPUNIT" == "1" || "$COVERAGE" == "1" || "$PHPCS" == "1" || "$PHPLINT" == "1" ]]; then
travis_retry composer install --no-interaction --ignore-platform-reqs --no-scripts --no-suggest
elif [[ "$PHPUNIT" == "1" || "$COVERAGE" == "1" || "$PHPLINT" == "1" ]]; then
# Run composer update as we have dev dependencies locked at PHP ^7.0 versions.
travis_retry composer update
travis_retry composer install --no-interaction
composer du
if [[ "$IS_PREMIUM" == "1" ]]; then
if [[ "$PHPCS" == "1" || "$PHPLINT" == "1" ]]; then
cd premium
travis_retry composer install --no-interaction
cd -
fi
fi
elif [[ "$TRAVIS_BUILD_STAGE_NAME" == "🚀 deployment" ]]; then
travis_retry composer update
travis_retry composer install --no-dev --no-interaction
Expand Down Expand Up @@ -258,24 +254,9 @@ script:
- |
if [[ "$PHPLINT" == "1" ]]; then
travis_fold start "PHP.check" && travis_time_start
if [[ "$IS_PREMIUM" == "1" ]]; then
cd premium && composer lint && cd -
else
composer lint
fi
composer lint
travis_time_finish && travis_fold end "PHP.check"
fi
# PHP CS
- |
if [[ "$PHPCS" == "1" ]]; then
travis_fold start "PHP.code-style" && travis_time_start
if [[ "$IS_PREMIUM" == "1" ]]; then
cd premium && composer check-cs && cd -
else
composer check-cs-threshold
fi
travis_time_finish && travis_fold end "PHP.code-style"
fi
# PHP Unit
- |
if [[ "$PHPUNIT" == "1" && ${TRAVIS_PHP_VERSION:0:1} != "8" && $TRAVIS_PHP_VERSION != "nightly" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -80,7 +80,7 @@
"Yoast\\WP\\SEO\\Composer\\Actions::check_coding_standards"
],
"check-cs-thresholds": [
"@putenv YOASTCS_THRESHOLD_ERRORS=330",
"@putenv YOASTCS_THRESHOLD_ERRORS=325",
"@putenv YOASTCS_THRESHOLD_WARNINGS=225",
"Yoast\\WP\\SEO\\Composer\\Actions::check_cs_thresholds"
],
Expand Down