Skip to content

Commit f3e0201

Browse files
committed
Update CI setup to ensure 100% code coverage
1 parent dc25560 commit f3e0201

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ jobs:
2626
coverage: xdebug
2727
- run: composer install
2828
- run: docker run --net=host -d redis
29-
- run: REDIS_URI=localhost:6379 vendor/bin/phpunit --coverage-text
29+
- run: REDIS_URI=localhost:6379 vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml
3030
if: ${{ matrix.php >= 7.3 }}
31-
- run: REDIS_URI=localhost:6379 vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
31+
- run: REDIS_URI=localhost:6379 vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml -c phpunit.xml.legacy
3232
if: ${{ matrix.php < 7.3 }}
33+
- name: Check 100% code coverage
34+
shell: php {0}
35+
run: |
36+
<?php
37+
$metrics = simplexml_load_file('clover.xml')->project->metrics;
38+
exit((int) $metrics['statements'] === (int) $metrics['coveredstatements'] ? 0 : 1);

0 commit comments

Comments
 (0)