Skip to content

Commit e4ecd1f

Browse files
committed
coverage added
1 parent 7d0817b commit e4ecd1f

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

.github/workflows/tests.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,9 @@ jobs:
3939
- name: Execute PHPcs
4040
run: vendor/bin/phpcs --standard=psr2 src/
4141

42-
- name: Execute PHPUnit
43-
run: vendor/bin/phpunit
42+
- name: Run tests and collect coverage
43+
run: vendor/bin/phpunit --coverage-clover coverage.xml .
44+
- name: Upload coverage to Codecov
45+
uses: codecov/codecov-action@v4
46+
env:
47+
CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}

phpunit.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="hexogen Test Suite">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<directory suffix=".php">src/</directory>
20+
</whitelist>
21+
</filter>
22+
<logging>
23+
<log type="tap" target="build/report.tap"/>
24+
<log type="junit" target="build/report.junit.xml"/>
25+
<log type="coverage-html" target="build/coverage"/>
26+
<log type="coverage-text" target="build/coverage.txt"/>
27+
<log type="coverage-clover" target="build/logs/clover.xml"/>
28+
</logging>
29+
<coverage cacheDirectory=".phpunit.cache/code-coverage"
30+
processUncoveredFiles="true">
31+
<include>
32+
<directory suffix=".php">src</directory>
33+
</include>
34+
</coverage>
35+
</phpunit>

0 commit comments

Comments
 (0)