Skip to content

Commit d4a4f60

Browse files
committed
Add coverage badge
1 parent afd346d commit d4a4f60

4 files changed

Lines changed: 31 additions & 19 deletions

File tree

.github/workflows/phpqa.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: "Static code analysis"
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
47

58
jobs:
69
static-code-analysis:
@@ -22,3 +25,27 @@ jobs:
2225
uses: docker://jakzal/phpqa:php8.5
2326
with:
2427
args: deptrac --config-file=depfile.yaml --no-interaction --ansi
28+
29+
coverage:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v6
33+
34+
- name: "Install PHP with coverage"
35+
uses: shivammathur/setup-php@v2
36+
with:
37+
php-version: "8.5"
38+
coverage: pcov
39+
tools: composer:v2
40+
41+
- name: "Install dependencies"
42+
run: composer install --no-interaction --no-progress
43+
44+
- name: "Run tests with coverage"
45+
run: vendor/bin/phpunit --coverage-clover clover.xml
46+
47+
- name: "Upload coverage to Codecov"
48+
uses: codecov/codecov-action@v6
49+
with:
50+
files: clover.xml
51+
fail_ci_if_error: false

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/composer.lock
33
/coverage.clover
44
/.phpunit.*
5+
/.deptrac.cache
6+
/.php-cs-fixer.cache
57
/vendor/
68
/.idea
79
/.composer

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
[![Latest Stable Version](https://img.shields.io/packagist/v/nicoswd/php-rule-parser.svg)](https://packagist.org/packages/nicoswd/php-rule-parser)
44
[![Total Downloads](https://img.shields.io/packagist/dt/nicoswd/php-rule-parser.svg)](https://packagist.org/packages/nicoswd/php-rule-parser)
5-
[![Build status][Master coverage image]][Master coverage]
65
[![Code Quality][Master quality image]][Master quality]
76
[![StyleCI](https://styleci.io/repos/39503126/shield?branch=master&style=flat)](https://styleci.io/repos/39503126)
7+
[![Code Coverage](https://img.shields.io/codecov/c/github/nicoSWD/php-rule-parser)](https://codecov.io/gh/nicoSWD/php-rule-parser)
88

99
A PHP library that parses and evaluates boolean expressions using a JavaScript-like syntax. It supports variables, comparison and logical operators, arithmetic, regular expressions, arrays, string methods, and function calls, all from plain text rules.
1010

@@ -291,7 +291,5 @@ Pull requests are very welcome! If they include tests, even better. This project
291291
[![License](https://img.shields.io/packagist/l/nicoSWD/php-rule-parser.svg)](https://packagist.org/packages/nicoswd/php-rule-parser)
292292

293293
[Master]: https://github.com/nicoSWD/php-rule-parser/tree/master
294-
[Master coverage image]: https://scrutinizer-ci.com/g/nicoSWD/php-rule-parser/badges/coverage.png?b=master
295-
[Master coverage]: https://scrutinizer-ci.com/g/nicoSWD/php-rule-parser/?branch=master
296294
[Master quality image]: https://img.shields.io/scrutinizer/g/nicoswd/php-rule-parser.svg?b=master
297295
[Master quality]: https://scrutinizer-ci.com/g/nicoSWD/php-rule-parser/?branch=master

phpunit.xml.dist.bak

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)