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

PHP 8.0 and PHPCS: partly fix compatibility with composer packages #643

Merged
merged 2 commits into from
Jun 1, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/php-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ jobs:
- php: '8.0'
wp: '5.7'
allowed_failure: true
# PHP nightly.
- php: '8.1'
wp: '5.7'
allowed_failure: true

steps:
- name: Checkout code
uses: actions/checkout@master
Expand Down Expand Up @@ -57,10 +54,13 @@ jobs:
run: bash bin/install-wp-tests.sh wordpress_test root root localhost ${{ matrix.wp }}

- name: Run PHPCS diff tests
# TODO: remove this condition when a new version of WPCS is released
# @see https://github.com/Automattic/Edit-Flow/issues/638#issuecomment-825511819
if: ${{ matrix.php < 8.0 }}
run: bash bin/phpcs-diff.sh

- name: Run PHPUnit tests (single site)
run: composer integration

- name: Run PHPUnit tests (multisite)
run: composer integration-ms
run: composer integration-ms
6 changes: 3 additions & 3 deletions bin/phpcs-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ DIFF_FILE=$(mktemp)
PHPCS_FILE=$(mktemp)

git remote set-branches --add origin master
git fetch
git fetch origin master
git diff origin/master > $DIFF_FILE

$DIR/../vendor/bin/phpcs --extensions=php --standard=phpcs.xml.dist --report=json > $PHPCS_FILE || true
$DIR/../vendor/bin/phpcs --extensions=php --standard=phpcs.xml.dist --report=json > $PHPCS_FILE || true

$DIR/../vendor/bin/diffFilter --phpcs $DIFF_FILE $PHPCS_FILE 0
$DIR/../vendor/bin/diffFilter --phpcs $DIFF_FILE $PHPCS_FILE 100
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the previous value 0, this test will never yell exit with an error status. Therefore, we can not recognize issues when running CI.
Ref: https://github.com/exussum12/coverageChecker#usage

4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"require-dev": {
"automattic/vipwpcs": "^2.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7",
"exussum12/coverage-checker": "^0.11.2",
"exussum12/coverage-checker": "^0.11.2 || ^1.0.0",
"phpunit/phpunit": "^4 || ^5 || ^6 || ^7"
},
"scripts": {
Expand All @@ -28,4 +28,4 @@
"@composer integration"
]
}
}
}