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

Release WordPressCS 3.1.0 #2439

Merged
merged 69 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
dd9b567
Add dependabot configuration file
jrfnl Sep 12, 2023
991cf21
Fix the release date in the changelog
dingo-d Sep 14, 2023
e02529f
Merge pull request #2384 from WordPress/feature/add-dependabot-config…
GaryJones Sep 14, 2023
82d5c91
GH Actions: Bump actions/checkout from 3 to 4
dependabot[bot] Sep 14, 2023
1a8bdf2
Merge pull request #2388 from WordPress/hofix/changelog-date-update
jrfnl Sep 14, 2023
e6b3033
Merge pull request #2389 from WordPress/dependabot/github_actions/act…
GaryJones Sep 14, 2023
25033a6
Add defensive coding to posts per page sniff and add tests
dingo-d Sep 18, 2023
54ad2d7
Merge pull request #2392 from WordPress/hotfix/2390-internal-error
jrfnl Sep 18, 2023
1d95bda
README: minor tweak
jrfnl Sep 20, 2023
7722c0b
Merge pull request #2393 from WordPress/feature/readme-minor-tweak
GaryJones Sep 20, 2023
9636f2b
IsUnitTestTrait: add new testcase as introduced in WP Core
jrfnl Sep 5, 2023
2b961ed
Add sanitize_locale_name() to escaping functions and unslashing sanit…
Chouby Oct 10, 2023
01a62b3
Ruleset: update a URL
jrfnl Oct 25, 2023
0bec4fa
GH Actions: minor tweaks
jrfnl Nov 14, 2023
4e4a2cf
GH Actions: update for the release of PHP 8.3
jrfnl Nov 23, 2023
191b292
Merge pull request #2407 from WordPress/feature/helpers-isunittesttra…
dingo-d Nov 23, 2023
27a7191
Merge pull request #2406 from WordPress/feature/extra-update-url-in-docs
dingo-d Nov 23, 2023
2c6a44f
Merge pull request #2405 from WordPress/feature/ghactions-minor-tweaks
dingo-d Nov 23, 2023
fe78958
Merge pull request #2404 from WordPress/feature/ghactions-php-8.3-update
jrfnl Nov 23, 2023
253a1fc
Use two new sniffs from PHPCSExtra 1.2.0
jrfnl Dec 3, 2023
5a94dee
Update funding information
jrfnl Nov 14, 2023
17cc585
Merge pull request #2409 from WordPress/feature/phpcsextra-1.2.0-sniffs
dingo-d Dec 3, 2023
9e2bfd3
Fix the test case file path used in a CONTRIBUTING.md example
rodrigoprimo Dec 5, 2023
a4b330a
PHPStan: ignore two new issues
jrfnl Dec 8, 2023
b595dc4
Merge pull request #2410 from WordPress/feature/update-funding
dingo-d Dec 10, 2023
a521f60
Merge pull request #2412 from jrfnl/feature/fix-phpstan
dingo-d Dec 10, 2023
15e1fc9
Switch to PHPCSStandards/PHP_CodeSniffer
jrfnl Nov 7, 2023
184db66
Revert changes to the Composer package name
jrfnl Dec 7, 2023
7b03ef5
Composer: raise the minimum supported PHPCS version to 3.8.0
jrfnl Nov 14, 2023
bf168c6
Composer: update various version constraints
jrfnl Nov 14, 2023
105a10c
DeprecatedFunctionsUnitTest: remove work-around for PHPCS bug
jrfnl Dec 8, 2023
44f3abb
Merge pull request #2408 from WordPress/feature/switch-to-fork-of-phpcs
dingo-d Dec 10, 2023
8a455f0
GH Actions/fixer conflict check: remove temporary exclusion
jrfnl May 28, 2023
0aa6cf7
Merge pull request #2397 from Chouby/sanitize_locale_name
jrfnl Dec 11, 2023
15c3037
Merge pull request #2413 from WordPress/feature/ghactions-remove-excl…
GaryJones Dec 11, 2023
bb305f8
Tests: allow for PHPUnit 8/9
jrfnl Dec 8, 2023
627a5d3
Core: remove an exclusion
jrfnl Dec 11, 2023
49bc4b7
Merge pull request #2415 from WordPress/feature/core-closure-use-keyw…
dingo-d Dec 12, 2023
5f0c8a7
Merge pull request #2414 from WordPress/feature/phpunit-cross-version
GaryJones Dec 12, 2023
01c27cb
GH Actions: test against different versions of all CS dependencies
jrfnl Dec 12, 2023
e900d13
Merge pull request #2417 from WordPress/feature/ghactions-improve-wor…
GaryJones Dec 14, 2023
c49b8c3
Merge pull request #2418 from rodrigoprimo/fix-typo-in-contributing-md
dingo-d Dec 15, 2023
ec26b0e
EscapeOutput: Fix typos in code comments
GaryJones Jan 3, 2024
eaa70fe
Merge pull request #2419 from WordPress/fix/escape-output-code-commen…
dingo-d Jan 3, 2024
b74817f
GH Actions: minor tweaks
jrfnl Feb 11, 2024
cdda1f2
GH Actions: move code coverage build without MbString to PHP 7.2
jrfnl Feb 16, 2024
f985e0a
Merge pull request #2424 from WordPress/feature/ghactions-minor-tweaks
dingo-d Feb 16, 2024
1ea048b
GH Actions: Bump ramsey/composer-install from 2 to 3
dependabot[bot] Mar 4, 2024
d15a466
Merge pull request #2428 from WordPress/dependabot/github_actions/ram…
dingo-d Mar 4, 2024
9d29ddc
Composer: raise the minimum supported PHPCS version to 3.9.0
jrfnl Feb 16, 2024
92751a1
Extra: do not allow ambiguous conditions
jrfnl Feb 16, 2024
95904f3
WhiteSpace/OperatorSpacing: add extra test
jrfnl Mar 5, 2024
ae6d254
Merge pull request #2429 from WordPress/feature/update-for-phpcs-3.9.0
GaryJones Mar 5, 2024
8b1a52e
Merge pull request #2430 from WordPress/feature/operatorspacing-sync-…
dingo-d Mar 5, 2024
1a3c8e5
GH Actions: Bump mondeja/remove-labels-gh-action from 1 to 2
dependabot[bot] Mar 18, 2024
a87abeb
PHPStan config: update for release of PHPCSUtils 1.0.10
jrfnl Mar 18, 2024
ca9184e
Merge pull request #2432 from WordPress/feature/phpstan-fix-build
dingo-d Mar 19, 2024
b54bf25
Merge pull request #2431 from WordPress/dependabot/github_actions/mon…
dingo-d Mar 19, 2024
ca426e7
NamingConventions/PrefixAllGlobals: update the functions list based o…
jrfnl Mar 21, 2024
c6513cf
NamingConventions/ValidPostTypeSlug: update the reserved post types l…
jrfnl Mar 21, 2024
5e988d8
WP/ClassNameCase: update the class lists based on WP 6.5-RC3
jrfnl Mar 21, 2024
8b1ef9b
WP/DeprecatedClasses: update the class list based on WP 6.5-RC3
jrfnl Mar 21, 2024
16d40a0
WP/DeprecatedFunctions: update the functions list based on WP 6.5-RC3
jrfnl Mar 21, 2024
4e384e2
Update the `minimum_wp_version` to WP 6.2
jrfnl Mar 21, 2024
d4afaba
Composer: raise the minimum supported PHPCSUtils version to 1.0.10
jrfnl Mar 21, 2024
0119a3f
Merge pull request #2436 from WordPress/feature/update-list-based-sni…
dingo-d Mar 22, 2024
fe959de
Merge pull request #2437 from WordPress/feature/composer-update-phpcs…
jrfnl Mar 22, 2024
87ab204
Changelog for the release of WordPressCS 3.1.0
jrfnl Nov 14, 2023
cf2cffe
Merge pull request #2438 from WordPress/feature/changelog-release-3.1.0
jrfnl Mar 25, 2024
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
16 changes: 8 additions & 8 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Bug reports containing a minimal code sample which can be used to reproduce the
Since WordPressCS employs many sniffs that are part of PHP_CodeSniffer itself or PHPCSExtra, sometimes an issue will be caused by a bug in PHPCS or PHPCSExtra and not in WordPressCS itself.
If the error message in question doesn't come from a sniff whose name starts with `WordPress`, the issue is probably a bug in PHPCS or PHPCSExtra.

* Bugs for sniffs starting with `Generic`, `PEAR`, `PSR1`, `PSR2`, `PSR12`, `Squiz` or `Zend` should be [reported to PHPCS](https://github.com/squizlabs/PHP_CodeSniffer/issues).
* Bugs for sniffs starting with `Generic`, `PEAR`, `PSR1`, `PSR2`, `PSR12`, `Squiz` or `Zend` should be [reported to PHPCS](https://github.com/PHPCSStandards/PHP_CodeSniffer/issues).
* Bugs for sniffs starting with `Modernize`, `NormalizedArrays` or `Universal` should be [reported to PHPCSExtra](https://github.com/PHPCSStandards/PHPCSExtra/issues).

# Contributing patches and new features
Expand All @@ -39,10 +39,10 @@ When you introduce new `public` sniff properties, or your sniff extends a class

## Pre-requisites
* WordPress-Coding-Standards
* PHP_CodeSniffer 3.7.2 or higher
* PHPCSUtils 1.0.8 or higher
* PHPCSExtra 1.1.0 or higher
* PHPUnit 4.x, 5.x, 6.x or 7.x
* PHP_CodeSniffer 3.9.0 or higher
* PHPCSUtils 1.0.10 or higher
* PHPCSExtra 1.2.1 or higher
* PHPUnit 4.x - 9.x

The WordPress Coding Standards use the `PHP_CodeSniffer` native unit test framework for unit testing the sniffs.

Expand Down Expand Up @@ -85,9 +85,9 @@ phpunit --filter WordPress /path/to/PHP_CodeSniffer/tests/AllTests.php

Expected output:
```
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.
PHPUnit 9.6.15 by Sebastian Bergmann and contributors.

Runtime: PHP 7.4.33
Runtime: PHP 8.3.0
Configuration: /WordPressCS/phpunit.xml.dist

......................................................... 57 / 57 (100%)
Expand Down Expand Up @@ -138,7 +138,7 @@ Also note the class name convention. The method `getErrorList()` MUST return an
If you run the following from the root directory of your WordPressCS clone:

```sh
$ "vendor/bin/phpcs" --standard=Wordpress -s ./Tests/PHP/POSIXFunctionsUnitTest.inc --sniffs=WordPress.PHP.POSIXFunctions
$ "vendor/bin/phpcs" --standard=Wordpress -s ./WordPress/Tests/PHP/POSIXFunctionsUnitTest.inc --sniffs=WordPress.PHP.POSIXFunctions
...
--------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
Expand Down
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
custom: "https://opencollective.com/thewpcc/contribute/wp-php-63406"
custom: "https://opencollective.com/php_codesniffer"
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Dependabot configuration.
#
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
time: "09:00"
open-pull-requests-limit: 5
commit-message:
prefix: "GH Actions:"
labels:
- "Type: Chores/Cleanup"
2 changes: 1 addition & 1 deletion .github/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ PR for tracking changes for the x.x.x release. Target release date: **DOW MONTH
- [ ] Submit for ["Month in WordPress"][month-in-wp].
- [ ] Submit for the ["Monthy Dev Roundup"][dev-roundup].

[phpcs-releases]: https://github.com/squizlabs/PHP_CodeSniffer/releases
[phpcs-releases]: https://github.com/PHPCSStandards/PHP_CodeSniffer/releases
[phpcsutils-releases]: https://github.com/PHPCSStandards/PHPCSUtils/releases
[phpcsextra-releases]: https://github.com/PHPCSStandards/PHPCSExtra/releases
[month-in-wp]: https://make.wordpress.org/community/month-in-wordpress-submissions/
Expand Down
67 changes: 42 additions & 25 deletions .github/workflows/basic-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PHPCS_DEV: 'dev-master'
UTILS_DEV: 'dev-develop'
EXTRA_DEV: 'dev-develop'

jobs:
# Check code style of sniffs, rulesets and XML documentation.
# Check that all sniffs are feature complete.
Expand All @@ -24,7 +29,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -37,12 +42,16 @@ jobs:
- name: Validate the composer.json file
run: composer validate --no-check-all --strict

# Using PHPCS `master` as an early detection system for bugs upstream.
- name: Set PHPCS version
run: composer require squizlabs/php_codesniffer:"dev-master" --no-update --no-scripts --no-interaction
# Using dev versions of the dependencies as an early detection system for bugs upstream.
- name: "Composer: set PHPCS dependencies (dev)"
run: >
composer require --no-update --no-scripts --no-interaction
squizlabs/php_codesniffer:"${{ env.PHPCS_DEV }}"
phpcsstandards/phpcsutils:"${{ env.UTILS_DEV }}"
phpcsstandards/phpcsextra:"${{ env.EXTRA_DEV }}"

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")
Expand All @@ -54,7 +63,8 @@ jobs:

# Show XML violations inline in the file diff.
# @link https://github.com/marketplace/actions/xmllint-problem-matcher
- uses: korelstar/xmllint-problem-matcher@v1
- name: Enable showing XML issues inline
uses: korelstar/xmllint-problem-matcher@v1

- name: Check the code style of the PHP files
id: phpcs
Expand Down Expand Up @@ -92,19 +102,19 @@ jobs:

# Makes sure the rulesets don't throw unexpected errors or warnings.
# This workflow needs to be run against a high PHP version to prevent triggering the syntax error check.
# It also needs to be run against all PHPCS versions WPCS is tested against.
# It also needs to be run against all dependency versions WPCS is tested against.
ruleset-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 'latest' ]
phpcs_version: [ 'lowest', 'dev-master' ]
dependencies: [ 'lowest', 'stable', 'dev' ]

name: "Ruleset test: PHP ${{ matrix.php }} on PHPCS ${{ matrix.phpcs_version }}"
name: "Ruleset test: PHP ${{ matrix.php }} on PHPCS ${{ matrix.dependencies }}"

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
Expand All @@ -114,20 +124,28 @@ jobs:
ini-values: error_reporting = E_ALL & ~E_DEPRECATED
coverage: none

- name: "Set PHPCS version (master)"
if: ${{ matrix.phpcs_version != 'lowest' }}
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction
- name: "Composer: set PHPCS dependencies for tests (dev)"
if: ${{ matrix.dependencies == 'dev' }}
run: >
composer require --no-update --no-scripts --no-interaction
squizlabs/php_codesniffer:"${{ env.PHPCS_DEV }}"
phpcsstandards/phpcsutils:"${{ env.UTILS_DEV }}"
phpcsstandards/phpcsextra:"${{ env.EXTRA_DEV }}"

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
composer-options: --no-dev
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: "Set PHPCS version (lowest)"
if: ${{ matrix.phpcs_version == 'lowest' }}
run: composer update squizlabs/php_codesniffer --prefer-lowest --ignore-platform-req=php+ --no-scripts --no-interaction
- name: "Composer: downgrade PHPCS dependencies for tests (lowest)"
if: ${{ matrix.dependencies == 'lowest' }}
run: >
composer update --prefer-lowest --no-scripts --no-interaction
squizlabs/php_codesniffer
phpcsstandards/phpcsutils
phpcsstandards/phpcsextra

- name: Test the WordPress-Core ruleset
run: $(pwd)/vendor/bin/phpcs -ps ./Tests/RulesetCheck/class-ruleset-test.inc --standard=WordPress-Core
Expand All @@ -150,15 +168,14 @@ jobs:
# Test for fixer conflicts by running the auto-fixers of the complete WPCS over the test case files.
# This is not an exhaustive test, but should give an early indication for typical fixer conflicts.
# If only fixable errors are found, the exit code will be 1, which can be interpreted as success.
#
# Note: the ValidVariableNameUnitTest.inc file is temporarily ignored until upstream PHPCS PR 3833 has been merged.
# This check is only run against "dev" as conflicts can not be fixed for already released versions.
- name: Test for fixer conflicts (fixes expected)
if: ${{ matrix.phpcs_version == 'dev-master' }}
if: ${{ matrix.dependencies == 'dev' }}
id: phpcbf
continue-on-error: true
run: |
set +e
$(pwd)/vendor/bin/phpcbf -pq ./WordPress/Tests/ --standard=WordPress --extensions=inc --exclude=Generic.PHP.Syntax --report=summary --ignore=/WordPress/Tests/NamingConventions/ValidVariableNameUnitTest.inc,/WordPress/Tests/WP/GlobalVariablesOverrideUnitTest.7.inc
$(pwd)/vendor/bin/phpcbf -pq ./WordPress/Tests/ --standard=WordPress --extensions=inc --exclude=Generic.PHP.Syntax --report=summary --ignore=/WordPress/Tests/WP/GlobalVariablesOverrideUnitTest.7.inc
exitcode="$?"
echo "EXITCODE=$exitcode" >> $GITHUB_OUTPUT
exit "$exitcode"
Expand All @@ -174,20 +191,20 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: 'latest'
coverage: none
tools: phpstan

# Install dependencies and handle caching in one go.
# Dependencies need to be installed to make sure the PHPCS and PHPUnit classes are recognized.
# @link https://github.com/marketplace/actions/install-composer-dependencies
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/manage-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Clean up labels on PR merge

steps:
- uses: mondeja/remove-labels-gh-action@v1
- uses: mondeja/remove-labels-gh-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
Expand All @@ -31,7 +31,7 @@ jobs:
name: Clean up labels on PR close

steps:
- uses: mondeja/remove-labels-gh-action@v1
- uses: mondeja/remove-labels-gh-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
Expand All @@ -46,7 +46,7 @@ jobs:
name: Clean up labels on issue close

steps:
- uses: mondeja/remove-labels-gh-action@v1
- uses: mondeja/remove-labels-gh-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
Expand Down
68 changes: 23 additions & 45 deletions .github/workflows/quicktest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,74 +23,52 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '5.4', '7.4', 'latest' ]
phpcs_version: [ 'lowest', 'dev-master' ]
php: [ '5.4', 'latest' ]
dependencies: [ 'lowest', 'stable' ]

name: QTest - PHP ${{ matrix.php }} on PHPCS ${{ matrix.phpcs_version }}
name: QTest - PHP ${{ matrix.php }} on PHPCS ${{ matrix.dependencies }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

# On stable PHPCS versions, allow for PHP deprecation notices.
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
- name: Setup ini config
id: set_ini
run: |
if [ "${{ matrix.phpcs_version }}" != "dev-master" ]; then
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> $GITHUB_OUTPUT
else
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> $GITHUB_OUTPUT
fi
uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
# With stable PHPCS dependencies, allow for PHP deprecation notices.
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
ini-values: error_reporting=-1, display_errors=On
coverage: ${{ github.ref_name == 'develop' && 'xdebug' || 'none' }}

- name: "Set PHPCS version (master)"
if: ${{ matrix.phpcs_version != 'lowest' }}
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

- name: Install Composer dependencies (PHP < 8.0 )
if: ${{ matrix.php < 8.0 && matrix.php != 'latest' }}
uses: ramsey/composer-install@v2
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: Install Composer dependencies (PHP >= 8.0)
if: ${{ matrix.php >= 8.0 || matrix.php == 'latest' }}
uses: ramsey/composer-install@v2
with:
composer-options: --ignore-platform-req=php+
custom-cache-suffix: $(date -u "+%Y-%m")

- name: "Set PHPCS version (lowest)"
if: ${{ matrix.phpcs_version == 'lowest' }}
run: composer update squizlabs/php_codesniffer --prefer-lowest --ignore-platform-req=php+ --no-scripts --no-interaction
- name: "Composer: downgrade PHPCS dependencies for tests (lowest)"
if: ${{ matrix.dependencies == 'lowest' }}
run: >
composer update --prefer-lowest --no-scripts --no-interaction
squizlabs/php_codesniffer
phpcsstandards/phpcsutils
phpcsstandards/phpcsextra

- name: Lint PHP files against parse errors
if: ${{ matrix.phpcs_version == 'dev-master' }}
run: composer lint -- --checkstyle
if: ${{ matrix.dependencies == 'stable' }}
run: composer lint

- name: Run the unit tests without code coverage - PHP 5.4 - 8.0
if: ${{ matrix.php == '5.4' && github.ref_name != 'develop' }}
- name: Run the unit tests without code coverage
if: ${{ github.ref_name != 'develop' }}
run: composer run-tests

# Until PHPCS supports PHPUnit 9, we cannot run code coverage on PHP 8.0+, so run it on PHP 5.4 and 7.4.
- name: Run the unit tests with code coverage - PHP 5.4 - 8.0
if: ${{ matrix.php != 'latest' && github.ref_name == 'develop' }}
- name: Run the unit tests with code coverage
if: ${{ github.ref_name == 'develop' }}
run: composer coverage

- name: Run the unit tests without code coverage - PHP >= 8.1
if: ${{ matrix.php == 'latest' }}
run: composer run-tests -- --no-configuration --bootstrap=./Tests/bootstrap.php --dont-report-useless-tests

- name: Send coverage report to Codecov
if: ${{ success() && github.ref_name == 'develop' && matrix.php != 'latest' }}
if: ${{ success() && github.ref_name == 'develop' }}
uses: codecov/codecov-action@v3
with:
files: ./build/logs/clover.xml
Expand Down
Loading
Loading