Skip to content

Commit 82d12bb

Browse files
committed
Update phpunit.xml.dist
1 parent 770406f commit 82d12bb

File tree

3 files changed

+70
-35
lines changed

3 files changed

+70
-35
lines changed

.github/workflows/code_coverage.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Code Coverage
2+
3+
# Controls when the workflow will run
4+
on:
5+
push:
6+
branches: [master]
7+
pull_request:
8+
branches: [master]
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
jobs:
15+
test:
16+
# The type of runner that the job will run on
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: true
20+
matrix:
21+
os: [ubuntu-latest]
22+
php: [8.3]
23+
laravel: [10.*]
24+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - OS ${{ matrix.os }}
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v2
29+
with:
30+
fetch-depth: 1
31+
- name: Setup PHP v${{ matrix.php }}
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: ${{ matrix.php }}
35+
extensions: mbstring, exif, iconv, tokenizer, fileinfo, xdebug
36+
coverage: xdebug
37+
38+
- name: Install dependencies
39+
run: |
40+
composer require "laravel/framework=${{ matrix.laravel }}" --no-update
41+
composer update --prefer-dist --no-interaction --no-progress
42+
43+
- name: PHPUnit
44+
run: |
45+
./vendor/bin/phpunit --stop-on-failure --coverage-clover ./clover.xml -c ./phpunit_conf/phpunit_${{ matrix.php }}.xml.dist
46+
env:
47+
XDEBUG_MODE: coverage
48+
- name: Make code coverage badge
49+
uses: timkrase/phpunit-coverage-badge@v1.2.1
50+
with:
51+
coverage_badge_path: output/coverage.svg
52+
push_badge: false
53+
54+
- name: Git push to image-data branch
55+
uses: peaceiris/actions-gh-pages@v3
56+
with:
57+
publish_dir: ./output
58+
publish_branch: image-data
59+
github_token: ${{ secrets.GITHUB_TOKEN }}
60+
user_name: 'github-actions[bot]'
61+
user_email: 'github-actions[bot]@users.noreply.github.com'

.github/workflows/tests.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,4 @@ jobs:
8585
8686
- name: PHPUnit
8787
run: |
88-
./vendor/bin/phpunit --stop-on-failure --coverage-clover ./clover.xml -c ./phpunit_conf/phpunit_${{ matrix.php }}.xml.dist
89-
env:
90-
XDEBUG_MODE: coverage
91-
- name: Make code coverage badge
92-
if: ${{ matrix.php }} > 8.2
93-
uses: timkrase/phpunit-coverage-badge@v1.2.1
94-
with:
95-
coverage_badge_path: output/coverage.svg
96-
push_badge: false
97-
98-
- name: Git push to image-data branch
99-
if: ${{ matrix.php }} > 8.2
100-
uses: peaceiris/actions-gh-pages@v3
101-
with:
102-
publish_dir: ./output
103-
publish_branch: image-data
104-
github_token: ${{ secrets.GITHUB_TOKEN }}
105-
user_name: 'github-actions[bot]'
106-
user_email: 'github-actions[bot]@users.noreply.github.com'
88+
./vendor/bin/phpunit --stop-on-failure -c ./phpunit_conf/phpunit_${{ matrix.php }}.xml.dist

phpunit_conf/phpunit_8.2.xml.dist

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,25 @@
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
44
bootstrap="./../vendor/autoload.php"
5+
cacheDirectory=".phpunit.cache"
56
executionOrder="depends,defects"
7+
requireCoverageMetadata="false"
8+
beStrictAboutCoverageMetadata="false"
69
beStrictAboutOutputDuringTests="true"
710
failOnRisky="true"
811
failOnWarning="true"
9-
backupGlobals="false"
10-
colors="true"
11-
processIsolation="false"
12-
stopOnError="false"
13-
stopOnFailure="false"
1412
>
1513

1614
<testsuites>
1715
<testsuite name="default">
1816
<directory>./../tests</directory>
1917
</testsuite>
2018
</testsuites>
21-
<coverage>
22-
<include>
23-
<directory suffix=".php">./../src</directory>
24-
</include>
25-
</coverage>
26-
<filter>
27-
<whitelist processUncoveredFilesFromWhitelist="true">
28-
<directory suffix=".php">./../src</directory>
29-
<exclude></exclude>
30-
</whitelist>
31-
</filter>
19+
<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
20+
<include>
21+
<directory>./../src</directory>
22+
</include>
23+
</source>
3224
<php>
3325
<env name="APP_ENV" value="testing"/>
3426
<env name="CACHE_DRIVER" value="array"/>

0 commit comments

Comments
 (0)