Skip to content

Commit

Permalink
Update phpunit.xml.dist
Browse files Browse the repository at this point in the history
  • Loading branch information
imanghafoori1 committed Jun 15, 2024
1 parent 3e8186e commit c7d0c0f
Show file tree
Hide file tree
Showing 18 changed files with 315 additions and 30 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
/.gitignore export-ignore
/.travis.yml export-ignore
/.styleci.yml export-ignore
/phpunit.xml.dist export-ignore
/phpunit.xml export-ignore
/readme.md export-ignore
/phpunit.bat export-ignore
/.scrutinizer.yml export-ignore
/tests export-ignore
/.editorconfig export-ignore
/phpunit_conf export-ignore
60 changes: 60 additions & 0 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Code Coverage

# Controls when the workflow will run
on:
push:
branches: [master]
pull_request:
branches: [master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.3]
laravel: [10.*]
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - OS ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 3
- name: Setup PHP v${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, exif, iconv, tokenizer, fileinfo, xdebug
coverage: xdebug

- name: Install dependencies
run: |
composer require "laravel/framework=${{ matrix.laravel }}" --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: PHPUnit
run: |
./vendor/bin/phpunit --stop-on-failure --coverage-clover ./clover.xml -c ./phpunit_conf/coverage.xml.dist
env:
XDEBUG_MODE: coverage

#- name: Make code coverage badge
# uses: timkrase/[email protected]
# with:
# coverage_badge_path: output/coverage.svg
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# push_badge: true
- name: Upload coverage results to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=./clover.xml --json_path=./coverall.xml -v
12 changes: 8 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]
php: [7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3]
laravel: [6.*, 7.*, 8.*, 9.*, 10.*, 11.*]
laravel: [6.*, 7.*, 8.*, 9.*, 10.*]
exclude:
- php: 7.2
laravel: 8.*
Expand Down Expand Up @@ -62,12 +62,15 @@ jobs:
laravel: 11.*
- php: 8.0
laravel: 11.*
- php: 8.1
laravel: 11.*
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - OS ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

with:
fetch-depth: 1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -79,5 +82,6 @@ jobs:
run: |
composer require "laravel/framework=${{ matrix.laravel }}" --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Run tests
run: vendor/bin/phpunit
- name: PHPUnit
run: |
./vendor/bin/phpunit --stop-on-failure -c ./phpunit_conf/phpunit_${{ matrix.php }}.xml.dist
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Laravel Widgetize
[![Latest Stable Version](https://poser.pugx.org/imanghafoori/laravel-widgetize/v/stable)](https://packagist.org/packages/imanghafoori/laravel-widgetize)
[![Awesome Laravel](https://img.shields.io/badge/Awesome-Laravel-brightgreen.svg)](https://github.com/chiraggude/awesome-laravel)
[![Monthly Downloads](https://poser.pugx.org/imanghafoori/laravel-widgetize/d/monthly)](https://packagist.org/packages/imanghafoori/laravel-widgetize/stats)
[![Code Coverage](https://scrutinizer-ci.com/g/imanghafoori1/laravel-widgetize/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/imanghafoori1/laravel-widgetize/?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/imanghafoori1/laravel-widgetize/badge.svg?branch=master)](https://coveralls.io/github/imanghafoori1/laravel-widgetize?branch=master)
[![tests](https://github.com/imanghafoori1/laravel-widgetize/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/imanghafoori1/laravel-widgetize/actions/workflows/tests.yml)
[![Imports](https://github.com/imanghafoori1/laravel-widgetize/actions/workflows/imports.yml/badge.svg?branch=master)](https://github.com/imanghafoori1/laravel-widgetize/actions/workflows/imports.yml)
</p>
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
},
"require-dev": {
"orchestra/testbench": "~3.0|~4.0|~5.0|~6.0|~7.0|~8.0",
"orchestra/testbench": "~3.0|~4.0|~5.0|~6.0|~7.0|~8.0|~9.0|~10.0",
"imanghafoori/php-imports-analyzer": "1.0.*",
"barryvdh/laravel-debugbar": ">=v1.0.0",
"mockery/mockery": ">=0.9"
Expand Down
22 changes: 0 additions & 22 deletions phpunit.xml.dist

This file was deleted.

19 changes: 19 additions & 0 deletions phpunit_conf/coverage.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="./../vendor/autoload.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" backupGlobals="false" colors="true" processIsolation="false" stopOnError="false" stopOnFailure="false" cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="default">
<directory>./../tests</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
</php>
<source>
<include>
<directory suffix=".php">./../src</directory>
</include>
<exclude/>
</source>
</phpunit>
33 changes: 33 additions & 0 deletions phpunit_conf/phpunit_7.2.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="./../vendor/autoload.php"
executionOrder="depends,defects"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
backupGlobals="false"
colors="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
>

<testsuites>
<testsuite name="default">
<directory>./../tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./../src</directory>
<exclude></exclude>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
</php>
</phpunit>
33 changes: 33 additions & 0 deletions phpunit_conf/phpunit_7.3.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="./../vendor/autoload.php"
executionOrder="depends,defects"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
backupGlobals="false"
colors="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
>

<testsuites>
<testsuite name="default">
<directory>./../tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./../src</directory>
<exclude></exclude>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
</php>
</phpunit>
33 changes: 33 additions & 0 deletions phpunit_conf/phpunit_7.4.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="./../vendor/autoload.php"
executionOrder="depends,defects"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
backupGlobals="false"
colors="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
>

<testsuites>
<testsuite name="default">
<directory>./../tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./../src</directory>
<exclude></exclude>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
</php>
</phpunit>
33 changes: 33 additions & 0 deletions phpunit_conf/phpunit_8.1.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="./../vendor/autoload.php"
executionOrder="depends,defects"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
backupGlobals="false"
colors="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
>

<testsuites>
<testsuite name="default">
<directory>./../tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./../src</directory>
<exclude></exclude>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
</php>
</phpunit>
29 changes: 29 additions & 0 deletions phpunit_conf/phpunit_8.2.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="./../vendor/autoload.php"
cacheDirectory=".phpunit.cache"
executionOrder="depends,defects"
requireCoverageMetadata="false"
beStrictAboutCoverageMetadata="false"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
>

<testsuites>
<testsuite name="default">
<directory>./../tests</directory>
</testsuite>
</testsuites>
<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
<include>
<directory>./../src</directory>
</include>
</source>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
</php>
</phpunit>
19 changes: 19 additions & 0 deletions phpunit_conf/phpunit_8.3.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="./../vendor/autoload.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" backupGlobals="false" colors="true" processIsolation="false" stopOnError="false" stopOnFailure="false" cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="default">
<directory>./../tests</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
</php>
<source>
<include>
<directory suffix=".php">./../src</directory>
</include>
<exclude/>
</source>
</phpunit>
33 changes: 33 additions & 0 deletions phpunit_conf/phpunit_8.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="./../vendor/autoload.php"
executionOrder="depends,defects"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
backupGlobals="false"
colors="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
>

<testsuites>
<testsuite name="default">
<directory>./../tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./../src</directory>
<exclude></exclude>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
</php>
</phpunit>
Loading

0 comments on commit c7d0c0f

Please sign in to comment.