diff --git a/.gitattributes b/.gitattributes index ac13f25a..f30be0a3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,5 +7,6 @@ tests/ export-ignore .editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore +.scrutinizer.yml export-ignore .styleci.yml export-ignore phpunit.yml export-ignore diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index fb958e1c..a92d6f5b 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -34,3 +34,33 @@ jobs: run: | mkdir -p build/logs vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover + + scrutinizer: + runs-on: ubuntu-latest + + 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-dist --no-progress --no-interaction --no-suggest + + - name: Execute tests + run: | + mkdir -p build/logs + vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover + + - name: Scrutinizer CI + run: | + wget https://scrutinizer-ci.com/ocular.phar + php ocular.phar code-coverage:upload --format=php-clover coverage.clover diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 00000000..bceddfd9 --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,38 @@ +filter: + excluded_paths: + - .github/* + - 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: 300 + runs: 6 + php_code_sniffer: + enabled: true + config: + standard: PSR12 + filter: + paths: [ 'src' ] + php_loc: + enabled: true + php_cpd: + enabled: true diff --git a/README.md b/README.md index 5312ecec..2361caf9 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![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] [![Stable Version][badge_stable]][link_packagist] @@ -164,6 +165,8 @@ php artisan migrate:actions:status [badge_license]: https://img.shields.io/packagist/l/andrey-helldar/laravel-actions.svg?style=flat-square +[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/andrey-helldar/laravel-actions.svg?style=flat-square + [badge_quality]: https://img.shields.io/scrutinizer/g/andrey-helldar/laravel-actions.svg?style=flat-square [badge_stable]: https://img.shields.io/github/v/release/andrey-helldar/laravel-actions?label=stable&style=flat-square