@@ -109,114 +109,3 @@ jobs:
109109
110110 - name : Run the unit tests 
111111 run : composer test 
112- 113-  # ### CODE COVERAGE STAGE ####
114-  #  N.B.: Coverage is only checked on the lowest and highest stable PHP versions
115-  #  and low/high for PHPCS.
116-  coverage :
117-  #  No use running the coverage builds if there are failing test builds.
118-  needs : test 
119-  runs-on : ubuntu-latest 
120- 121-  strategy :
122-  matrix :
123-  include :
124-  - php : ' 8.2' 
125-  phpcs_version : ' dev-master' 
126-  - php : ' 7.4' 
127-  phpcs_version : ' 3.5.6' 
128- 129-  - php : ' 5.4' 
130-  phpcs_version : ' dev-master' 
131-  - php : ' 5.4' 
132-  phpcs_version : ' 3.5.6' 
133- 134-  name : " Coverage: PHP ${{ matrix.php }} on PHPCS ${{ matrix.phpcs_version }}" 
135- 136-  steps :
137-  - name : Checkout code 
138-  uses : actions/checkout@v3 
139- 140-  - name : Setup ini config 
141-  id : set_ini 
142-  run : | 
143-  # On stable PHPCS versions, allow for PHP deprecation notices. 
144-  # Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore. 
145-  if [ "${{ matrix.phpcs_version }}" != "dev-master" ]; then 
146-  echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On, zend.assertions=1' >> $GITHUB_OUTPUT 
147-  else 
148-  echo 'PHP_INI=error_reporting=-1, display_errors=On, zend.assertions=1' >> $GITHUB_OUTPUT 
149-  fi 
150- 
151-  - name : Install PHP 
152-  uses : shivammathur/setup-php@v2 
153-  with :
154-  php-version : ${{ matrix.php }} 
155-  ini-values : ${{ steps.set_ini.outputs.PHP_INI }} 
156-  coverage : xdebug 
157- 158-  - name : ' Composer: adjust dependencies' 
159-  run : | 
160-  # Remove dev dependencies which are not compatible with all supported PHP/PHPCS versions. 
161-  composer remove --dev --no-update phpcsstandards/phpcsdevcs sirbrillig/phpcs-import-detection phpstan/phpstan 
162-  composer require --no-update squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" 
163- 
164-  - name : Install Composer dependencies 
165-  uses : " ramsey/composer-install@v2" 
166-  with :
167-  #  Bust the cache at least once a month - output format: YYYY-MM.
168-  custom-cache-suffix : $(date -u "+%Y-%m") 
169- 170-  - name : Grab PHPUnit version 
171-  id : phpunit_version 
172-  run : echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT 
173- 174-  - name : " DEBUG: Show grabbed version" 
175-  run : echo ${{ steps.phpunit_version.outputs.VERSION }} 
176- 177-  #  PHPUnit 9.3 started using PHP-Parser for code coverage which can cause interference.
178-  #  As of PHPUnit 9.3.4, a cache warming option is available.
179-  #  Using that option prevents issues with PHP-Parser backfilling PHP tokens when PHPCS does not (yet),
180-  #  which would otherwise cause tests to fail on tokens being available when they shouldn't be.
181-  - name : " Warm the PHPUnit cache (PHPUnit 9.3+)" 
182-  if : ${{ steps.phpunit_version.outputs.VERSION >= '9.3' }} 
183-  run : vendor/bin/phpunit --coverage-cache ./build/phpunit-cache --warm-coverage-cache 
184- 185-  - name : " Run the unit tests with code coverage (PHPUnit < 9.3)" 
186-  if : ${{ steps.phpunit_version.outputs.VERSION < '9.3' }} 
187-  run : composer coverage 
188- 189-  - name : " Run the unit tests with code coverage (PHPUnit 9.3+)" 
190-  if : ${{ steps.phpunit_version.outputs.VERSION >= '9.3' }} 
191-  run : composer coverage -- --coverage-cache ./build/phpunit-cache 
192- 193-  #  PHP Coveralls v2 has a PHP 5.5 minimum and is not yet fully compatible with PHP 8.0+, so switch the PHP version.
194-  - name : Switch to PHP 7.4 
195-  if : ${{ success() && matrix.php != '7.4' }} 
196-  uses : shivammathur/setup-php@v2 
197-  with :
198-  php-version : 7.4 
199-  coverage : none 
200- 201-  - name : Install Coveralls 
202-  if : ${{ success() }} 
203-  run : composer require php-coveralls/php-coveralls:"^2.5.2" --no-interaction --with-all-dependencies 
204- 205-  - name : Upload coverage results to Coveralls 
206-  if : ${{ success() }} 
207-  env :
208-  COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }} 
209-  COVERALLS_PARALLEL : true 
210-  COVERALLS_FLAG_NAME : php-${{ matrix.php }}-phpcs-${{ matrix.phpcs_version }} 
211-  run : vendor/bin/php-coveralls -v -x build/logs/clover.xml 
212- 213-  coveralls-finish :
214-  needs : coverage 
215-  runs-on : ubuntu-latest 
216- 217-  steps :
218-  - name : Coveralls Finished 
219-  uses : coverallsapp/github-action@master 
220-  with :
221-  github-token : ${{ secrets.GITHUB_TOKEN }} 
222-  parallel-finished : true 
0 commit comments