Skip to content

Commit e6bc62d

Browse files
Merge pull request #230 from antonioribeiro/fix-coverage
Fix coverage on codeconv
2 parents 6916e30 + 4397636 commit e6bc62d

File tree

2 files changed

+31
-5
lines changed

2 files changed

+31
-5
lines changed

.github/workflows/phpunit.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,33 @@ jobs:
9797
- name: Install dependencies
9898
run: composer install --prefer-dist --no-interaction --no-progress
9999

100+
- name: Check Xdebug status
101+
run: php -m | grep -i xdebug
102+
100103
- name: Execute tests with coverage
101-
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
104+
run: |
105+
echo "Current working directory: $(pwd)"
106+
echo "PHPUnit command: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover"
107+
export XDEBUG_MODE=coverage
108+
echo "Xdebug mode set to: $XDEBUG_MODE"
109+
vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
110+
echo "PHPUnit exit code: $?"
111+
112+
- name: Check if coverage file was created
113+
run: |
114+
echo "Checking for coverage file..."
115+
echo "Current directory contents:"
116+
ls -la
117+
echo "Looking for clover files:"
118+
ls -la *.clover 2>/dev/null || echo "No clover files found in current directory"
119+
echo "Searching entire directory tree:"
120+
find . -name "*.clover" -type f 2>/dev/null || echo "No clover files found anywhere"
121+
echo "Checking if Xdebug coverage mode is working:"
122+
php -r "echo 'Xdebug mode: ' . (getenv('XDEBUG_MODE') ?: 'not set') . PHP_EOL;"
102123
103124
- name: Upload coverage reports to Codecov
104125
uses: codecov/codecov-action@v5
105126
with:
106-
token: ${{ secrets.CODECOV_TOKEN }}
127+
token: ${{ secrets.CODECOV_TOKEN }}
128+
files: coverage.clover
129+
fail_ci_if_error: false

phpunit.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.3/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
44
bootstrap="tests/bootstrap.php"
55
colors="true"
66
processIsolation="false"
77
stopOnError="false"
88
stopOnFailure="true"
9-
cacheDirectory=".phpunit.cache"
109
backupGlobals="false"
11-
backupStaticProperties="false"
1210
>
1311
<testsuites>
1412
<testsuite name="Test Suite">
1513
<directory suffix="Test.php">./tests</directory>
1614
</testsuite>
1715
</testsuites>
16+
<filter>
17+
<whitelist>
18+
<directory suffix=".php">./src</directory>
19+
</whitelist>
20+
</filter>
1821
</phpunit>

0 commit comments

Comments
 (0)