diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 61338ca6..f3cf2913 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2,7 +2,7 @@ name: CI
on:
push:
- branches: [ master, main ]
+ branches: [ master, main, feature/coverage-reporting ]
pull_request:
branches: [ master, main ]
@@ -46,4 +46,85 @@ jobs:
run: vendor/bin/phpstan analyse
- name: Run tests
- run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml
\ No newline at end of file
+ run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml --coverage-html build/coverage
+
+ - name: Upload coverage reports
+ uses: actions/upload-artifact@v4
+ if: matrix.php-versions == '8.3'
+ with:
+ name: coverage-report
+ path: build/coverage
+
+ deploy-coverage:
+ needs: test
+ runs-on: ubuntu-latest
+ if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/feature/coverage-reporting'
+ permissions:
+ contents: write
+ pages: write
+ id-token: write
+
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: ${{ github.ref }}
+
+ - name: Download coverage report
+ uses: actions/download-artifact@v4
+ with:
+ name: coverage-report
+ path: coverage
+
+ - name: Extract coverage percentage
+ id: coverage
+ run: |
+ # Try to extract percentage from HTML report
+ if [ -f coverage/index.html ]; then
+ # Look for the Total row and extract percentage
+ COVERAGE=$(grep -A3 '
Total | ' coverage/index.html | grep -oP '\d+\.\d+(?=%)' | head -1 || true)
+ if [ -z "$COVERAGE" ]; then
+ # Fallback: look for any percentage in success class
+ COVERAGE=$(grep '' coverage/index.html | grep -oP '\d+\.\d+' | head -1 || true)
+ fi
+ echo "Coverage found: ${COVERAGE}%"
+ echo "percentage=${COVERAGE:-0}" >> $GITHUB_OUTPUT
+ else
+ echo "percentage=0" >> $GITHUB_OUTPUT
+ fi
+
+ - name: Update coverage badge
+ if: success()
+ run: |
+ COVERAGE=${{ steps.coverage.outputs.percentage }}
+ COLOR="red"
+ if (( $(echo "$COVERAGE >= 80" | bc -l) )); then
+ COLOR="brightgreen"
+ elif (( $(echo "$COVERAGE >= 60" | bc -l) )); then
+ COLOR="yellow"
+ elif (( $(echo "$COVERAGE >= 40" | bc -l) )); then
+ COLOR="orange"
+ fi
+
+ # Update the badge in README.md
+ sed -i "s/coverage-[0-9.]*%25-[a-z]*/coverage-${COVERAGE}%25-${COLOR}/g" README.md
+
+ # Check if there are changes and commit them
+ if ! git diff --quiet README.md; then
+ git config user.name "GitHub Actions"
+ git config user.email "actions@github.com"
+ git add README.md
+ git commit -m "Update coverage badge to ${COVERAGE}%"
+ git push origin ${{ github.ref }}
+ fi
+
+ - name: Setup Pages
+ uses: actions/configure-pages@v4
+
+ - name: Upload to Pages
+ uses: actions/upload-pages-artifact@v3
+ with:
+ path: coverage
+
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v4
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5b4312f5..ef1fde35 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+### Added
+- GitHub Pages coverage reporting with HTML reports
+- Automatic coverage badge updates in README
+- GitHub Actions CI badge
+
+### Changed
+- Updated all GitHub Actions to v4 to fix deprecation warnings
+- Improved PHPUnit configuration with proper coverage filters
+
+### Removed
+- Code Climate badges (service discontinued)
+
## [3.0.0] - 2025-08-28
### Added
diff --git a/README.md b/README.md
index 36c92cfb..5981e0ea 100644
--- a/README.md
+++ b/README.md
@@ -8,10 +8,8 @@ Currently supports:
- **ČSOB SK** - Slovak ČSOB emails (SkCsobMailParser)
-[](http://travis-ci.org/tomaj/bank-mails-parser)
-[](https://codeclimate.com/github/tomaj/bank-mails-parser/coverage)
-[](https://codeclimate.com/github/tomaj/bank-mails-parser)
-
+[](https://github.com/tomaj/bank-mails-parser/actions/workflows/ci.yml)
+[](https://tomaj.github.io/bank-mails-parser/)
[](https://packagist.org/packages/tomaj/bank-mails-parser)
[](https://packagist.org/packages/tomaj/bank-mails-parser)
[](https://packagist.org/packages/tomaj/bank-mails-parser)
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 75b98b42..e0e9a3fb 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -1,8 +1,12 @@
+
+ ./src
+
+
|