Skip to content

Commit f1eb0bd

Browse files
authored
Add Codecov integration (#60)
1 parent 92fdf82 commit f1eb0bd

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
/.gitattributes export-ignore
44
/.gitignore export-ignore
55
/.php-cs-fixer.dist.php export-ignore
6+
/codecov.yml export-ignore
67
/phpstan.neon.dist export-ignore
78
/phpunit.xml.dist export-ignore

.github/workflows/test-unit.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,16 @@ jobs:
153153
run: |
154154
php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-phpunit-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi)
155155
156-
- name: Upload coverage (only for coverage)
157-
if: env.LOG_COVERAGE && false # TODO
156+
- name: Upload coverage logs 1/2 (only for coverage)
157+
if: env.LOG_COVERAGE
158+
run: |
159+
ls -l coverage | wc -l
160+
php -d memory_limit=2G vendor/bin/phpcov merge coverage/ --clover coverage/merged.xml
161+
162+
- name: Upload coverage logs 2/2 (only for coverage)
163+
if: env.LOG_COVERAGE
158164
uses: codecov/codecov-action@v5
159165
with:
160166
token: ${{ secrets.CODECOV_TOKEN }}
161167
fail_ci_if_error: true
162-
files: coverage/phpunit.cov
168+
files: coverage/merged.xml

codecov.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
comment: false
2+
coverage:
3+
status:
4+
project:
5+
default:
6+
target: auto
7+
threshold: 0.025
8+
patch: false
9+
changes: false

0 commit comments

Comments
 (0)