Skip to content

Commit e1dad7d

Browse files
authored
Merge pull request #842 from nimesh-xecurify/codecov-integration
Integrates Codecov for PHP code coverage
2 parents 2ace85b + cff6fc4 commit e1dad7d

3 files changed

Lines changed: 46 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
with:
116116
timeout_minutes: 10
117117
max_attempts: 3
118-
command: npm run env start
118+
command: npm run env start -- --xdebug=coverage
119119

120120
- name: Composer install
121121
run: |
@@ -130,6 +130,14 @@ jobs:
130130
- name: Test
131131
run: npm run test
132132

133+
- name: Upload code coverage report
134+
if: ${{ matrix.php == '8.3' && matrix.wp == 'latest' }}
135+
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
136+
with:
137+
file: tests/logs/clover.xml
138+
flags: phpunit
139+
fail_ci_if_error: false
140+
133141
build:
134142
name: Build
135143
runs-on: ubuntu-24.04

codecov.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Overall settings for PR integration via codecov.io
2+
# See https://docs.codecov.com/docs/codecovyml-reference
3+
4+
# Separate PR statuses for project-level and patch-level coverage
5+
# See https://docs.codecov.com/docs/commit-status
6+
coverage:
7+
status:
8+
# Project-level coverage
9+
project:
10+
default:
11+
base: auto
12+
# Disable once code base is more mature.
13+
informational: true
14+
only_pulls: true
15+
target: auto
16+
threshold: 5%
17+
18+
# Patch-level coverage (how well is the PR tested)
19+
patch:
20+
default:
21+
base: auto
22+
informational: true
23+
only_pulls: true
24+
target: auto
25+
threshold: 50%
26+
27+
# Pull request comments
28+
# See https://docs.codecov.com/docs/pull-request-comments
29+
comment: false
30+
31+
# See https://docs.codecov.com/docs/ignoring-paths
32+
ignore:
33+
- tests
34+
- vendor
35+
- node_modules
36+
- dist

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
![WordPress.org Rating](https://img.shields.io/wordpress/plugin/rating/two-factor?label=WP.org%20Rating) ![WordPress Plugin Downloads](https://img.shields.io/wordpress/plugin/dt/two-factor?label=WP.org%20Downloads) ![WordPress Plugin Active Installs](https://img.shields.io/wordpress/plugin/installs/two-factor?label=WP.org%20Active%20Installs) [![WordPress Playground Demo](https://img.shields.io/wordpress/plugin/v/two-factor?logo=wordpress&logoColor=FFFFFF&label=Live%20Demo&labelColor=3858E9&color=3858E9)](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/WordPress/two-factor/master/.wordpress-org/blueprints/blueprint.json)
77

8-
[![Test](https://github.com/WordPress/two-factor/actions/workflows/test.yml/badge.svg)](https://github.com/WordPress/two-factor/actions/workflows/test.yml) [![Deploy](https://github.com/WordPress/two-factor/actions/workflows/deploy.yml/badge.svg)](https://github.com/WordPress/two-factor/actions/workflows/deploy.yml)
8+
[![Test](https://github.com/WordPress/two-factor/actions/workflows/test.yml/badge.svg)](https://github.com/WordPress/two-factor/actions/workflows/test.yml) [![Deploy](https://github.com/WordPress/two-factor/actions/workflows/deploy.yml/badge.svg)](https://github.com/WordPress/two-factor/actions/workflows/deploy.yml) [![codecov](https://codecov.io/gh/WordPress/two-factor/graph/badge.svg)](https://codecov.io/gh/WordPress/two-factor)
99

1010
> Two-Factor plugin for WordPress. [View on WordPress.org →](https://wordpress.org/plugins/two-factor/)
1111

0 commit comments

Comments
 (0)