86
86
- php : " 8.2"
87
87
phpcs_version : " 4.x-dev"
88
88
89
- name : " Test: PHP ${{ matrix.php }}"
89
+ name : " Test: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }} "
90
90
91
91
steps :
92
92
- name : Checkout code
@@ -110,8 +110,8 @@ jobs:
110
110
ini-values : ${{ steps.set_ini.outputs.PHP_INI }}
111
111
coverage : none
112
112
113
- - name : " Composer: set PHPCS version for tests (dev)"
114
- if : ${{ contains( matrix.phpcs_version, 'dev') }}
113
+ - name : " Composer: set PHPCS version for tests (dev/specific version )"
114
+ if : ${{ matrix.phpcs_version != 'lowest' && matrix.phpcs_version != 'stable' }}
115
115
run : composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction
116
116
117
117
- name : " Composer: use lock file when necessary"
@@ -133,26 +133,18 @@ jobs:
133
133
- name : Composer info
134
134
run : composer info
135
135
136
- - name : Grab PHPUnit version
137
- id : phpunit_version
138
- run : echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> "$GITHUB_OUTPUT"
136
+ - name : Grab PHPCS version
137
+ id : phpcs_version
138
+ # yamllint disable-line rule:line-length
139
+ run : echo "VERSION=$(vendor/bin/phpcs --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> "$GITHUB_OUTPUT"
139
140
140
- - name : " DEBUG: Show grabbed PHPUnit version"
141
- run : echo ${{ steps.phpunit_version .outputs.VERSION }}
141
+ - name : " DEBUG: Show grabbed PHPCS version"
142
+ run : echo ${{ steps.phpcs_version .outputs.VERSION }}
142
143
143
- - name : Determine PHPUnit config file to use
144
- id : phpunit_config
145
- shell : bash
146
- run : |
147
- if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }}" == "true" ]; then
148
- echo 'FILE=phpunit.xml' >> "$GITHUB_OUTPUT"
149
- elif [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }}" == "true" ]; then
150
- echo 'FILE=phpunit.xml' >> "$GITHUB_OUTPUT"
151
- else
152
- echo 'FILE=phpunit-lte9.xml' >> "$GITHUB_OUTPUT"
153
- fi
144
+ - name : Run the unit tests (PHPCS 3.x)
145
+ if : ${{ startsWith( steps.phpcs_version.outputs.VERSION, '3.' ) }}
146
+ run : composer test-phpcs3
154
147
155
- - name : Run the unit tests
156
- run : composer test -- -c ${{ steps.phpunit_config.outputs.FILE }}
157
- env :
158
- PHPCS_VERSION : ${{ matrix.phpcs_version }}
148
+ - name : Run the unit tests (PHPCS 4.x)
149
+ if : ${{ startsWith( steps.phpcs_version.outputs.VERSION, '4.' ) }}
150
+ run : composer test-phpcs4
0 commit comments