Skip to content

Commit 57f35d7

Browse files
committed
codecov badge test
1 parent cc774c4 commit 57f35d7

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.github/workflows/codecov.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Code Coverage
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
coverage:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: '8.1'
23+
24+
- name: Install dependencies
25+
run: composer install
26+
27+
- name: Run tests and collect coverage
28+
run: vendor/bin/phpunit --coverage-clover coverage.xml
29+
30+
- name: Upload coverage to Codecov
31+
uses: codecov/codecov-action@v5
32+
with:
33+
token: ${{ secrets.CODECOV_TOKEN }}
34+
files: ./coverage.xml
35+
fail_ci_if_error: true
36+
verbose: true

phpunit.dist.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@
2424
</testsuite>
2525
</testsuites>
2626

27+
<coverage>
28+
<include>
29+
<directory>src/</directory>
30+
</include>
31+
<report>
32+
<clover outputFile="coverage.xml"/>
33+
</report>
34+
</coverage>
35+
2736
<php>
2837
<!-- <env name="NEO4J_ADDRESS" value="<put your address here>"/>-->
2938
<!-- <env name="NEO4J_USERNAME" value="<put your name here>"/>-->

0 commit comments

Comments
 (0)