From b4ba512d9f53331600db2911758fdf3ab0d1d5fb Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 9 Dec 2020 14:38:18 +0300 Subject: [PATCH 1/4] Revert scrutinizer --- .github/workflows/phpunit.yml | 30 +++++++++++++++++++++++++++ .scrutinizer.yml | 38 +++++++++++++++++++++++++++++++++++ README.md | 3 +++ 3 files changed, 71 insertions(+) create mode 100644 .scrutinizer.yml 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 From ab180f6275182904a08e55ca058638fc2aa3f022 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 9 Dec 2020 14:39:17 +0300 Subject: [PATCH 2/4] Update .gitattributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) 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 From a4dd52972c4cbb0ba90e7d0eebd0a2b058325912 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 9 Dec 2020 14:39:42 +0300 Subject: [PATCH 3/4] Update phpunit.yml --- .github/workflows/phpunit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index a92d6f5b..8670000b 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -45,7 +45,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.0 extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv coverage: xdebug From 9bec3ebec638432985bf59f1384fe0fa68fa19f7 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 9 Dec 2020 14:41:30 +0300 Subject: [PATCH 4/4] Revert php 7.4 for scrutinizer --- .github/workflows/phpunit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 8670000b..a92d6f5b 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -45,7 +45,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 7.4 extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv coverage: xdebug