Skip to content

Commit a7fc4ca

Browse files
committed
Configure xdebug and PHPUnit settings
- Added xdebug configuration in `devops/xdebug.ini` for coverage, debugging, and development mode - Updated PHPUnit settings in `phpunit.xml` to include coverage reports for the source directory - Adjusted display errors settings in xdebug and PHPUnit configuration for better error handling and reporting.
1 parent 174a287 commit a7fc4ca

File tree

6 files changed

+35
-2
lines changed

6 files changed

+35
-2
lines changed

.github/workflows/tests.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,19 @@ jobs:
2020
uses: shivammathur/setup-php@v2
2121
with:
2222
php-version: ${{ matrix.php }}
23-
extensions: zip
23+
extensions: zip, xdebug
24+
coverage: xdebug
2425

2526
- name: Install Dependencies
2627
run: composer install
2728

2829
- name: Run tests
29-
run: composer test
30+
run: composer test:coverage
31+
32+
- name: Upload coverage reports to Codecov
33+
if: ${{ matrix.php == '8.4' }}
34+
uses: codecov/[email protected]
35+
with:
36+
token: ${{ secrets.CODECOV_TOKEN }}
37+
file: ./tmp/clover.xml
38+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/.idea/
2+
/tmp/
23
/vendor/
34

45
.phpunit.result.cache

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@ ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/do
1212
RUN chmod +x /usr/local/bin/install-php-extensions && sync
1313
RUN install-php-extensions @composer xdebug
1414

15+
COPY devops/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
16+
RUN rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
17+
1518
WORKDIR /app

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Laravel Route Docs
22

33
[![Latest Version on Packagist](https://img.shields.io/packagist/v/mikegarde/laravel-route-docs.svg?style=flat-square)](https://packagist.org/packages/mikegarde/laravel-route-docs)
4+
[![codecov](https://codecov.io/gh/mikegarde/laravel-route-docs/branch/main/graph/badge.svg)](https://codecov.io/gh/mikegarde/laravel-route-docs)
45
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/mikegarde/laravel-route-docs/run-tests.yml?branch=main&label=tests)](https://github.com/mikegarde/laravel-route-docs/actions)
56
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE)
67

composer.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,19 @@
5353
],
5454
"minimum-stability": "stable",
5555
"prefer-stable": true,
56+
"config": {
57+
"sort-packages": true
58+
},
5659
"scripts": {
5760
"test": [
5861
"phpunit"
5962
],
63+
"test:coverage": [
64+
"phpunit --coverage-clover=tmp/clover.xml"
65+
],
66+
"test:report": [
67+
"phpunit --coverage-html=tmp/coverage"
68+
],
6069
"post-autoload-dump": [
6170
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump"
6271
]

devops/xdebug.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
zend_extension=xdebug.so
2+
3+
[xdebug]
4+
xdebug.mode=coverage,debug,develop
5+
xdebug.client_host=host.docker.internal
6+
xdebug.idekey=PHPSTORM
7+
8+
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
9+
display_startup_errors = Off
10+
display_errors = Off

0 commit comments

Comments
 (0)