Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ jobs:
apt-get install -y git unzip libzip-dev libxml2-dev
docker-php-ext-install xml zip
if [ "${{ matrix.php-version }}" = "8.3" ]; then
pecl install xdebug || echo "Warning: xdebug install failed, coverage may not work"
docker-php-ext-enable xdebug || true
pecl install xdebug
docker-php-ext-enable xdebug
php -m | grep xdebug || (echo "ERROR: Xdebug not enabled" && exit 1)
fi
php -v
php -m
Expand Down Expand Up @@ -61,14 +62,29 @@ jobs:

- name: Generate coverage report
if: matrix.php-version == '8.3'
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml
env:
XDEBUG_MODE: coverage
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-clover build/logs/clover.xml
ls -l build/logs/clover.xml

- name: Upload coverage to Coveralls
if: matrix.php-version == '8.3'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ ! -f build/logs/clover.xml ]; then
echo "ERROR: Coverage file build/logs/clover.xml was not generated"
echo "This likely means Xdebug is not properly installed or enabled"
exit 1
fi
composer global require php-coveralls/php-coveralls
export PATH="/root/.composer/vendor/bin:$PATH"
export PATH="$(composer global config bin-dir --absolute):$PATH"

# Fix: allow git discovery across the Actions workspace mount boundary
cd "$GITHUB_WORKSPACE"
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1

php-coveralls --coverage_clover=build/logs/clover.xml --json_path=build/logs/coveralls-upload.json -v
Loading