Skip to content

Commit fff66ce

Browse files
committed
trying coverage report
1 parent 50e2594 commit fff66ce

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

.github/workflows/coverage.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
- name: Setup PHP
15+
uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: 8.2
18+
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
19+
coverage: none
20+
- name: Install dependencies
21+
run: |
22+
composer require "laravel/framework:^10.0" "orchestra/testbench:8.*"
23+
composer update
24+
- name: Execute tests
25+
run: php -d xdebug.mode=coverage vendor/bin/phpunit ./tests --coverage-clover='reports/coverage/coverage.xml'
26+
- name: Upload coverage reports to Codecov
27+
uses: codecov/[email protected]
28+
with:
29+
token: ${{ secrets.CODECOV_TOKEN }}
30+
slug: matteoc99/laravel-preference
31+
files: ./reports/coverage/coverage.xml

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function getPreference(string $name, string $group = 'general', mixed $de
138138
139139
### Available Casts
140140

141-
INT, FLOAT, STRING, BOOL, ARRAY, DATE, DATETIME, TIMESTAMP
141+
INT, FLOAT, STRING, BOOL, ARRAY, TIME, DATE, DATETIME, TIMESTAMP
142142

143143
### Custom Caster
144144

phpunit.xml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
cacheDirectory=".phpunit.cache"
6+
executionOrder="depends,defects"
7+
beStrictAboutOutputDuringTests="true"
8+
failOnRisky="true"
9+
failOnWarning="true">
10+
<testsuites>
11+
<testsuite name="default">
12+
<directory>tests</directory>
13+
</testsuite>
14+
</testsuites>
15+
16+
<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
17+
<include>
18+
<directory>src</directory>
19+
</include>
20+
</source>
21+
</phpunit>

0 commit comments

Comments
 (0)