Skip to content

Commit 5f80788

Browse files
authored
Merge pull request #877 from PHPCSStandards/feature/ghactions-tests-join-some-steps
GH Actions/coverage: join some steps
2 parents f91c044 + 17e2796 commit 5f80788

File tree

1 file changed

+12
-23
lines changed

1 file changed

+12
-23
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -349,37 +349,26 @@ jobs:
349349
if: ${{ steps.phpunit_version.outputs.VERSION >= '9.3' }}
350350
run: php "vendor/bin/phpunit" --coverage-cache ./build/phpunit-cache --warm-coverage-cache
351351

352-
- name: "Run the unit tests with code coverage (PHPUnit < 9.3)"
353-
if: ${{ matrix.os != 'windows-latest' && steps.phpunit_version.outputs.VERSION < '9.3' }}
354-
run: php "vendor/bin/phpunit" tests/AllTests.php
355-
356-
- name: "Run the unit tests with code coverage (PHPUnit 9.3+)"
357-
if: ${{ matrix.os != 'windows-latest' && steps.phpunit_version.outputs.VERSION >= '9.3' }}
358-
run: php "vendor/bin/phpunit" tests/AllTests.php --coverage-cache ./build/phpunit-cache
359-
360-
- name: "Run select tests in CBF mode with code coverage (PHPUnit < 9.3)"
361-
if: ${{ matrix.os != 'windows-latest' && steps.phpunit_version.outputs.VERSION < '9.3' }}
352+
- name: "Run the unit tests with code coverage"
353+
if: ${{ matrix.os != 'windows-latest' }}
362354
run: >
363355
php "vendor/bin/phpunit" tests/AllTests.php
364-
--group CBF --exclude-group nothing --coverage-clover build/logs/clover-cbf.xml
365-
env:
366-
PHP_CODESNIFFER_CBF: '1'
356+
${{ steps.phpunit_version.outputs.VERSION >= '9.3' && '--coverage-cache ./build/phpunit-cache' || '' }}
367357
368-
- name: "Run select tests in CBF mode with code coverage (PHPUnit 9.3+)"
369-
if: ${{ matrix.os != 'windows-latest' && steps.phpunit_version.outputs.VERSION >= '9.3' }}
358+
- name: "Run select tests in CBF mode with code coverage"
359+
if: ${{ matrix.os != 'windows-latest' }}
370360
run: >
371-
php "vendor/bin/phpunit" tests/AllTests.php --coverage-cache ./build/phpunit-cache
361+
php "vendor/bin/phpunit" tests/AllTests.php
362+
${{ steps.phpunit_version.outputs.VERSION >= '9.3' && '--coverage-cache ./build/phpunit-cache' || '' }}
372363
--group CBF --exclude-group nothing --coverage-clover build/logs/clover-cbf.xml
373364
env:
374365
PHP_CODESNIFFER_CBF: '1'
375366

376-
- name: "Run the unit tests which may have different outcomes on Windows with code coverage (PHPUnit < 9.3)"
377-
if: ${{ matrix.os == 'windows-latest' && steps.phpunit_version.outputs.VERSION < '9.3' }}
378-
run: php "vendor/bin/phpunit" tests/AllTests.php --group Windows
379-
380-
- name: "Run the unit tests which may have different outcomes on Windows with code coverage (PHPUnit 9.3+)"
381-
if: ${{ matrix.os == 'windows-latest' && steps.phpunit_version.outputs.VERSION >= '9.3' }}
382-
run: php "vendor/bin/phpunit" tests/AllTests.php --group Windows --coverage-cache ./build/phpunit-cache
367+
- name: "Run the unit tests which may have different outcomes on Windows with code coverage"
368+
if: ${{ matrix.os == 'windows-latest' }}
369+
run: >
370+
php "vendor/bin/phpunit" tests/AllTests.php --group Windows
371+
${{ steps.phpunit_version.outputs.VERSION >= '9.3' && '--coverage-cache ./build/phpunit-cache' || '' }}
383372
384373
- name: "Upload coverage results to Coveralls (normal run)"
385374
if: ${{ success() }}

0 commit comments

Comments
 (0)