Skip to content

Commit b10e065

Browse files
committed
Add push coverage report to coveralls from CI
1 parent 4cbf2fc commit b10e065

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/continuous_integration.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,16 @@ jobs:
2424
- '8.1'
2525
dependencies:
2626
- 'highest'
27+
phpunit-args:
28+
- ''
2729
include:
2830
- php-version: '7.2'
2931
dependencies: 'lowest'
3032
- php-version: '8.1'
3133
dependencies: 'lowest'
3234
- php-version: '8.1'
35+
coverage: 'pcov'
36+
phpunit-args: '--coverage-clover coverage.xml'
3337

3438
steps:
3539
# Cancel previous runs of the same branch
@@ -46,14 +50,15 @@ jobs:
4650
with:
4751
php-version: '${{ matrix.php-version }}'
4852
tools: composer:v2
53+
coverage: '${{ matrix.coverage }}'
4954

5055
- name: Install dependencies with Composer
5156
uses: ramsey/composer-install@v1
5257
with:
5358
dependency-versions: '${{ matrix.dependencies }}'
5459

5560
- name: Run PHPUnit
56-
run: vendor/bin/phpunit
61+
run: vendor/bin/phpunit ${{ matrix.phpunit-args }}
5762

5863
- name: Validate composer
5964
run: composer validate --strict --no-check-lock
@@ -75,3 +80,9 @@ jobs:
7580
- name: Run php_codesniffer
7681
run: composer cs-check
7782
if: ${{ matrix.php-version == '7.2' }} # Do not suggest using features after 7.2
83+
84+
- name: Upload coverage results to Coveralls
85+
run: vendor/bin/php-coveralls --coverage_clover=coverage.xml -v
86+
if: ${{ matrix.coverage }}
87+
env:
88+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)