Skip to content

Commit 9fb0369

Browse files
nficanoclaude
andcommitted
ci: upload coverage to Codecov
phpunit.xml already declares <source> + pcov is enabled in the workflow. Emit Clover XML via --coverage-clover and upload it to Codecov non-blockingly. Requires CODECOV_TOKEN to be set as a repo secret. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 03afbaa commit 9fb0369

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,18 @@ jobs:
7373
if: hashFiles('.php-cs-fixer.dist.php', '.php-cs-fixer.php') != ''
7474
run: vendor/bin/php-cs-fixer fix --dry-run --diff
7575

76-
- name: Run PHPUnit
77-
run: vendor/bin/phpunit
76+
- name: Run PHPUnit (with Clover coverage)
77+
run: vendor/bin/phpunit --coverage-clover=coverage.xml
78+
79+
# Non-blocking: a Codecov outage cannot break CI.
80+
- name: Upload coverage to Codecov
81+
# codecov/codecov-action v6.0.1
82+
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
83+
with:
84+
fail_ci_if_error: false
85+
flags: unittests
86+
files: ./coverage.xml
87+
token: ${{ secrets.CODECOV_TOKEN }}
7888

7989
- name: Upload test artifacts on failure
8090
if: failure()

0 commit comments

Comments
 (0)