Skip to content

Commit 89e08c2

Browse files
committed
coverage test
1 parent eaf9a40 commit 89e08c2

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/run-tests.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,21 @@ jobs:
4646
with:
4747
php-version: ${{ matrix.php }}
4848
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
49-
coverage: none
49+
coverage: ${{ startsWith(github.event.head_commit.message, 'coverage') && matrix.php == '8.4' && matrix.laravel == '12.*' && matrix.stability == 'prefer-stable' && 'xdebug' || 'none' }}
5050

5151
- name: Install dependencies
5252
run: |
5353
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update
5454
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
5555
5656
- name: Execute tests
57-
run: vendor/bin/phpunit
57+
run: |
58+
vendor/bin/phpunit ${{ startsWith(github.event.head_commit.message, 'coverage') && matrix.php == '8.4' && matrix.laravel == '12.*' && matrix.stability == 'prefer-stable' && '--coverage-clover=clover.xml' || '' }}
59+
60+
- name: Make code coverage badge
61+
if: startsWith(github.event.head_commit.message, 'coverage') && matrix.php == '8.4' && matrix.laravel == '12.*' && matrix.stability == 'prefer-stable'
62+
uses: timkrase/phpunit-coverage-badge@v1.2.1
63+
with:
64+
coverage_badge_path: .github/coverage.svg
65+
push_badge: true
66+
repo_token: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Latest Version on Packagist](https://img.shields.io/packagist/v/javaabu/query-builder.svg?style=flat-square)](https://packagist.org/packages/javaabu/query-builder)
44
[![Test Status](../../actions/workflows/run-tests.yml/badge.svg)](../../actions/workflows/run-tests.yml)
5+
![Code Coverage Badge](./.github/coverage.svg)
56
[![Total Downloads](https://img.shields.io/packagist/dt/javaabu/query-builder.svg?style=flat-square)](https://packagist.org/packages/javaabu/query-builder)
67

78
Modifications on top of spatie/query-builder

0 commit comments

Comments
 (0)