You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-19Lines changed: 23 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# PR Test Coverage
2
2
3
-
A Github Action to report the test coverage of changed files in a pull request. All it needs is a clover.xml file. It provides a summary of the coverage for all files and changed files separately, and a detailed table with coverage metrics per changed file.
3
+
A Github Action to report the test coverage of changed files in a pull request. It uses PHPUnit XML coverage format. It provides a summary of the coverage for all files and changed files separately, and a detailed table with coverage metrics per changed file.
The action supports standard Clover XML format with the following metrics:
185
+
The action supports PHPUnit XML coverage format (generated with `--coverage-xml`) with the following metrics:
186
186
187
-
- **Lines**: `statements` (total lines) and `coveredstatements` (lines hit)
188
-
- **Functions**: `methods` (total methods) and `coveredmethods` (methods hit)
189
-
- **Branches**: `conditionals` (total branches) and `coveredconditionals` (branches hit)
187
+
- **Lines**: `executable` (total lines) and `executed` (lines hit)
188
+
- **Methods**: `count` (total methods) and `tested` (methods hit)
189
+
- **Functions**: `count` (total functions) and `tested` (functions hit)
190
190
191
191
## Common Integration Examples
192
192
@@ -202,10 +202,12 @@ The action supports standard Clover XML format with the following metrics:
202
202
- name: PR Test Coverage
203
203
uses: jbaczuk/pr-test-coverage@v1
204
204
with:
205
-
clover-file: coverage/clover.xml
205
+
coverage-xml-dir: coverage/clover.xml
206
206
github-token: ${{ secrets.GITHUB_TOKEN }}
207
207
```
208
208
209
+
Note: Jest generates Clover format, not PHPUnit XML. This action now primarily supports PHPUnit XML format. For Jest, you may need to convert the format or use a different action.
210
+
209
211
### Python with pytest-cov
210
212
211
213
```yaml
@@ -219,21 +221,23 @@ The action supports standard Clover XML format with the following metrics:
219
221
- name: PR Test Coverage
220
222
uses: jbaczuk/pr-test-coverage@v1
221
223
with:
222
-
clover-file: coverage.xml
224
+
coverage-xml-dir: coverage.xml
223
225
github-token: ${{ secrets.GITHUB_TOKEN }}
224
226
```
225
227
228
+
Note: pytest-cov generates Cobertura XML format, not PHPUnit XML. This action now primarily supports PHPUnit XML format.
0 commit comments