Skip to content

Commit 6a883a9

Browse files
authored
Merge pull request #139 from clue-labs/coverage
Update CI setup to ensure 100% code coverage
2 parents 377f9a6 + f3e0201 commit 6a883a9

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
@@ -27,7 +27,13 @@ jobs:
2727
ini-file: development
2828
- run: composer install
2929
- run: docker run --net=host -d redis
30-
- run: REDIS_URI=localhost:6379 vendor/bin/phpunit --coverage-text
30+
- run: REDIS_URI=localhost:6379 vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml
3131
if: ${{ matrix.php >= 7.3 }}
32-
- run: REDIS_URI=localhost:6379 vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
32+
- run: REDIS_URI=localhost:6379 vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml -c phpunit.xml.legacy
3333
if: ${{ matrix.php < 7.3 }}
34+
- name: Check 100% code coverage
35+
shell: php {0}
36+
run: |
37+
<?php
38+
$metrics = simplexml_load_file('clover.xml')->project->metrics;
39+
exit((int) $metrics['statements'] === (int) $metrics['coveredstatements'] ? 0 : 1);

0 commit comments

Comments
 (0)