Skip to content

Commit edf2c13

Browse files
committed
Enhance CI configuration to conditionally enable coverage and add Codecov badge to README
1 parent 8fca19b commit edf2c13

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
php-version: ${{ matrix.php }}
3333
extensions: dom, mbstring, zip, libxml, json, tokenizer, fileinfo
34-
coverage: none
34+
coverage: ${{ matrix.os == 'ubuntu-latest' && matrix.php == '8.5' && 'pcov' || 'none' }}
3535

3636
- name: Install Dependencies
3737
uses: ramsey/composer-install@v3
@@ -42,5 +42,17 @@ jobs:
4242
run: ./vendor/bin/phpstan analyse --no-progress
4343
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.3'
4444

45+
- name: Run Test Suite with Coverage (Pest)
46+
run: ./vendor/bin/pest --coverage --coverage-clover=clover.xml
47+
if: matrix.os == 'ubuntu-latest' && matrix.php == '9.0'
48+
49+
- name: Upload Coverage to Codecov
50+
uses: codecov/codecov-action@v4
51+
if: matrix.os == 'ubuntu-latest' && matrix.php == '9.0'
52+
with:
53+
files: clover.xml
54+
fail_ci_if_error: false
55+
4556
- name: Run Test Suite (Pest)
46-
run: ./vendor/bin/pest --compact
57+
run: ./vendor/bin/pest --compact
58+
if: "! (matrix.os == 'ubuntu-latest' && matrix.php == '8.5')"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
<p align="center">
99
<a href="https://github.com/typephp-php/typephp/actions"><img src="https://github.com/typephp-php/typephp/actions/workflows/ci.yml/badge.svg" alt="Build Status"></a>
10+
<a href="https://codecov.io/gh/typephp-php/typephp"><img src="https://codecov.io/gh/typephp-php/typephp/branch/main/graph/badge.svg" alt="Code Coverage"></a>
1011
<a href="https://packagist.org/packages/typephp/typephp"><img src="https://img.shields.io/packagist/v/typephp/typephp.svg?style=flat&color=blue" alt="Latest Stable Version"></a>
1112
<a href="https://packagist.org/packages/typephp/typephp"><img src="https://img.shields.io/packagist/dt/typephp/typephp.svg?style=flat&color=green" alt="Total Downloads"></a>
1213
<a href="https://choosealicense.com/licenses/mit/"><img src="https://img.shields.io/packagist/l/typephp/typephp.svg?style=flat" alt="License"></a>

0 commit comments

Comments
 (0)