9
9
pull_request :
10
10
paths-ignore :
11
11
- ' **.md'
12
+ # Allow manually triggering the workflow.
13
+ workflow_dispatch :
12
14
13
15
jobs :
14
16
test :
66
68
php-version : ${{ matrix.php }}
67
69
ini-values : ${{ steps.set_ini.outputs.PHP_INI }}
68
70
coverage : none
71
+ tools : cs2pr
69
72
70
73
# Install dependencies and handle caching in one go.
71
74
# @link https://github.com/marketplace/actions/install-composer-dependencies
75
78
76
79
# For PHP 8.0+, we need to install with ignore platform reqs as PHPUnit 7 is still used.
77
80
- name : Install Composer dependencies - with ignore platform
78
- if : ${{ matrix.custom_ini == false }}
81
+ if : ${{ matrix.php >= 8.0 }}
79
82
uses : " ramsey/composer-install@v1"
80
83
with :
81
84
composer-options : --ignore-platform-reqs
@@ -85,26 +88,30 @@ jobs:
85
88
- name : ' PHPCS: set the path to PHP'
86
89
run : php bin/phpcs --config-set php_path php
87
90
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.
96
91
- 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
99
94
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
103
101
104
102
- 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 }}
106
104
run : php bin/phpcs --no-cache --parallel=1
107
105
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
+
108
115
- name : ' Composer: validate config'
109
116
if : ${{ matrix.custom_ini == false }}
110
117
run : composer validate --no-check-all --strict
0 commit comments