Skip to content

Commit

Permalink
Merge pull request #32 from andrey-helldar/coverage
Browse files Browse the repository at this point in the history
Update coverage tests
  • Loading branch information
Andrey Helldar authored Dec 22, 2020
2 parents db33a28 + 95ebad9 commit ef08a16
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 36 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.gitmodules export-ignore
.scrutinizer.yml export-ignore
.styleci.yml export-ignore

phpunit.php export-ignore
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: coverage
on:
push:
branches:
- main
- coverage

jobs:
scrutinizer:
runs-on: ubuntu-latest

name: Coverage

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv
coverage: xdebug

- name: Composer self update
run: composer self-update

- name: Install dependencies
run: composer update --prefer-stable --prefer-dist --no-progress --no-interaction

- name: Execute tests
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-clover=coverage.clover
- name: Export
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
28 changes: 0 additions & 28 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,31 +265,3 @@ jobs:
- name: Execute tests
run: vendor/bin/phpunit

coverage:
runs-on: ubuntu-latest

name: Coverage

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv
coverage: xdebug

- name: Composer self update
run: composer self-update

- name: Install dependencies
run: |
composer update --prefer-stable --prefer-dist --no-progress --no-interaction
- name: Execute tests
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ vendor/
*.clover
*.orig

ocular.phar

composer.lock
38 changes: 38 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
filter:
excluded_paths:
- tests/*
- vendor/*

checks:
php:
code_rating: true
duplication: true
remove_extra_empty_lines: true
remove_php_closing_tag: true
remove_trailing_whitespace: true
fix_use_statements:
remove_unused: true
preserve_multiple: false
preserve_blanklines: true
order_alphabetically: true
fix_php_opening_tag: true
fix_linefeed: true
fix_line_ending: true
fix_identation_4spaces: true
fix_doc_comments: true

tools:
external_code_coverage:
timeout: 600
runs: 6
php_code_sniffer:
enabled: true
config:
standard: PSR12
filter:
paths:
- src
php_loc:
enabled: true
php_cpd:
enabled: true
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Visualise your routes in pretty format.

[![StyleCI Status][badge_styleci]][link_styleci]
[![Github Workflow Status][badge_build]][link_build]
[![Coverage Status][badge_coverage]][link_scrutinizer]
[![Scrutinizer Code Quality][badge_quality]][link_scrutinizer]
[![For Laravel][badge_laravel]][link_packagist]

[![Stable Version][badge_stable]][link_packagist]
Expand Down Expand Up @@ -77,24 +79,30 @@ php artisan vendor:publish --provider="PrettyRoutes\ServiceProvider"
| 7.4 | Supported, not tested | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| 8.0 | Not supported, not tested | :x: | :x: | :x: | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: |

[badge_styleci]: https://styleci.io/repos/130698068/shield

[badge_build]: https://img.shields.io/github/workflow/status/andrey-helldar/pretty-routes/phpunit?style=flat-square

[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/andrey-helldar/pretty-routes.svg?style=flat-square

[badge_downloads]: https://img.shields.io/packagist/dt/andrey-helldar/pretty-routes.svg?style=flat-square

[badge_laravel]: https://img.shields.io/badge/Laravel-5.x%20%7C%206.x%20%7C%207.x%20%7C%208.x-orange.svg?style=flat-square

[badge_stable]: https://img.shields.io/github/v/release/andrey-helldar/pretty-routes?label=stable&style=flat-square
[badge_license]: https://img.shields.io/packagist/l/andrey-helldar/pretty-routes.svg?style=flat-square

[badge_unstable]: https://img.shields.io/badge/unstable-dev--main-orange?style=flat-square
[badge_quality]: https://img.shields.io/scrutinizer/g/andrey-helldar/pretty-routes.svg?style=flat-square

[badge_downloads]: https://img.shields.io/packagist/dt/andrey-helldar/pretty-routes.svg?style=flat-square
[badge_stable]: https://img.shields.io/github/v/release/andrey-helldar/pretty-routes?label=stable&style=flat-square

[badge_license]: https://img.shields.io/packagist/l/andrey-helldar/pretty-routes.svg?style=flat-square
[badge_styleci]: https://styleci.io/repos/130698068/shield

[link_styleci]: https://github.styleci.io/repos/130698068
[badge_unstable]: https://img.shields.io/badge/unstable-dev--main-orange?style=flat-square

[link_build]: https://github.com/andrey-helldar/pretty-routes/actions

[link_license]: LICENSE

[link_packagist]: https://packagist.org/packages/andrey-helldar/pretty-routes

[link_license]: LICENSE
[link_scrutinizer]: https://scrutinizer-ci.com/g/andrey-helldar/pretty-routes/?branch=coverage

[link_styleci]: https://github.styleci.io/repos/130698068

0 comments on commit ef08a16

Please sign in to comment.