Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit 0950f57

Browse files
committed
Integrate codecov
Fix #17
1 parent d88cec5 commit 0950f57

File tree

4 files changed

+38
-27
lines changed

4 files changed

+38
-27
lines changed

.github/workflows/run-tests.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ jobs:
1010
matrix:
1111
os: [ubuntu-latest]
1212
php: [7.2, 7.3, 7.4]
13-
laravel: [6.*, 7.*, 8.*]
13+
laravel: [6, 7, 8]
1414
dependency-version: [prefer-lowest, prefer-stable]
1515
include:
16-
- laravel: 8.*
16+
- laravel: 8
1717
testbench: 6.*
18-
- laravel: 7.*
18+
- laravel: 7
1919
testbench: 5.*
20-
- laravel: 6.*
20+
- laravel: 6
2121
testbench: 4.*
2222
exclude:
23-
- laravel: 8.*
23+
- laravel: 8
2424
php: 7.2
2525

26-
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
26+
name: P${{ matrix.php }} - L${{ matrix.laravel }}.* - ${{ matrix.dependency-version }} - ${{ matrix.os }}
2727

2828
steps:
2929
- name: Checkout code
@@ -33,18 +33,28 @@ jobs:
3333
uses: actions/cache@v2
3434
with:
3535
path: ~/.composer/cache/files
36-
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
36+
key: dependencies-laravel-${{ matrix.laravel }}.*-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
3737

3838
- name: Setup PHP
3939
uses: shivammathur/setup-php@v2
4040
with:
4141
php-version: ${{ matrix.php }}
4242
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
43-
coverage: none
43+
coverage: pcov
4444

4545
- name: Install dependencies
4646
run: |
47-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
47+
composer require "laravel/framework:${{ matrix.laravel }}.*" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
4848
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
49+
4950
- name: Execute tests
50-
run: vendor/bin/phpunit
51+
run: vendor/bin/phpunit --coverage-clover=coverage.xml
52+
53+
- name: Upload test coverage to Codecov
54+
uses: codecov/codecov-action@v1
55+
with:
56+
token: ${{ secrets.CODECOV_TOKEN }}
57+
file: ./coverage.xml
58+
name: laravel-prerender
59+
flags: P${{ matrix.php }},L${{ matrix.laravel }},${{ matrix.dependency-version }},${{ matrix.os }}
60+
fail_ci_if_error: true

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ coverage
77
docs
88
vendor
99
.php_cs.cache
10-
coverage
10+
coverage.xml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Laravel | Prerender.io ![Tests](https://github.com/codebar-ag/Laravel-Prerender/workflows/Tests/badge.svg)
1+
Laravel | Prerender.io ![Tests](https://github.com/codebar-ag/Laravel-Prerender/workflows/Tests/badge.svg) ![codecov.io](https://codecov.io/github/codebar-ag/Laravel-Prerender/coverage.svg?branch=master)
22
===========================
33

44
## Credits

phpunit.xml.dist

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false"
11-
verbose="true"
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
5+
bootstrap="vendor/autoload.php"
6+
colors="true"
7+
verbose="true"
128
>
13-
<coverage>
14-
<include>
15-
<directory suffix=".php">src/</directory>
16-
</include>
17-
</coverage>
189
<testsuites>
1910
<testsuite name="codebar Test Suite">
2011
<directory>tests</directory>
2112
</testsuite>
2213
</testsuites>
14+
<filter>
15+
<whitelist processUncoveredFilesFromWhitelist="true">
16+
<directory suffix=".php">./src</directory>
17+
</whitelist>
18+
</filter>
19+
<coverage processUncoveredFiles="true">
20+
<include>
21+
<directory suffix=".php">./src</directory>
22+
</include>
23+
</coverage>
2324
</phpunit>

0 commit comments

Comments
 (0)