99 pull_request :
1010 paths-ignore :
1111 - ' **.md'
12+ # Allow manually triggering the workflow.
13+ workflow_dispatch :
1214
1315jobs :
1416 test :
6668 php-version : ${{ matrix.php }}
6769 ini-values : ${{ steps.set_ini.outputs.PHP_INI }}
6870 coverage : none
71+ tools : cs2pr
6972
7073 # Install dependencies and handle caching in one go.
7174 # @link https://github.com/marketplace/actions/install-composer-dependencies
7578
7679 # For PHP 8.0+, we need to install with ignore platform reqs as PHPUnit 7 is still used.
7780 - name : Install Composer dependencies - with ignore platform
78- if : ${{ matrix.custom_ini == false }}
81+ if : ${{ matrix.php >= 8.0 }}
7982 uses : " ramsey/composer-install@v1"
8083 with :
8184 composer-options : --ignore-platform-reqs
@@ -85,26 +88,30 @@ jobs:
8588 - name : ' PHPCS: set the path to PHP'
8689 run : php bin/phpcs --config-set php_path php
8790
88- # We need to remove the config file so that PHPUnit doesn't try to read it.
89- # This causes an error on PHP 8.1+ with PHPunit 7, but it's not needed here anyway as the
90- # phpunit command (below) specifies all required settings.
91- - name : ' PHPUnit: remove config file'
92- run : rm phpunit.xml.dist
93-
94- # Useless tests were not reported for before PHPUnit 6, so it doesn't
95- # understand the CLI argument.
9691 - name : ' PHPUnit: run the tests'
97- if : ${{ matrix.php < 7.0 }}
98- run : vendor/bin/phpunit tests/AllTests.php --bootstrap=tests/bootstrap.php
92+ if : ${{ matrix.php != 8.1 }}
93+ run : vendor/bin/phpunit tests/AllTests.php
9994
100- - name : ' PHPUnit: run the tests, dont report useless'
101- if : ${{ matrix.php >= 7.0 }}
102- run : vendor/bin/phpunit tests/AllTests.php --bootstrap=tests/bootstrap.php --dont-report-useless-tests
95+ # We need to ignore the config file so that PHPUnit doesn't try to read it.
96+ # The config file causes an error on PHP 8.1+ with PHPunit 7, but it's not needed here anyway
97+ # as we can pass all required settings in the phpunit command.
98+ - name : ' PHPUnit: run the tests on PHP nightly'
99+ if : ${{ matrix.php == 8.1 }}
100+ run : vendor/bin/phpunit tests/AllTests.php --no-configuration --bootstrap=tests/bootstrap.php --dont-report-useless-tests
103101
104102 - name : ' PHPCS: check code style without cache, no parallel'
105- if : ${{ matrix.custom_ini == false }}
103+ if : ${{ matrix.custom_ini == false && matrix.php != 7.4 }}
106104 run : php bin/phpcs --no-cache --parallel=1
107105
106+ - name : ' PHPCS: check code style to show results in PR'
107+ if : ${{ matrix.custom_ini == false && matrix.php == 7.4 }}
108+ continue-on-error : true
109+ run : php bin/phpcs --no-cache --parallel=1 --report-full --report-checkstyle=./phpcs-report.xml
110+
111+ - name : Show PHPCS results in PR
112+ if : ${{ matrix.custom_ini == false && matrix.php == 7.4 }}
113+ run : cs2pr ./phpcs-report.xml
114+
108115 - name : ' Composer: validate config'
109116 if : ${{ matrix.custom_ini == false }}
110117 run : composer validate --no-check-all --strict
0 commit comments