Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #634 from barbushin/develop
Develop
- Loading branch information
Showing
33 changed files
with
589 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
name: PHP Static Analysis & Tests | ||
|
||
on: | ||
push: | ||
branches: [ develop, 'issue/592' ] | ||
pull_request: | ||
branches: [ develop ] | ||
|
||
jobs: | ||
static-analysis: | ||
name: Static Analysis PHP ${{ matrix.php-versions }} | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
matrix: | ||
operating-system: ['ubuntu-20.04'] | ||
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1'] | ||
|
||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
coverage: none | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: | | ||
echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Cache Files | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
${{ steps.composer-cache.outputs.dir }} | ||
**/.php_cs.cache | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install dependencies | ||
if: steps.composer-cache.outputs.cache-hit != 'true' | ||
run: composer install --prefer-dist --no-progress --no-suggest | ||
|
||
- name: Run static analysis | ||
run: composer run static-analysis | ||
|
||
phpunit: | ||
name: PHP ${{ matrix.php-versions }} Unit Tests | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
matrix: | ||
operating-system: ['ubuntu-20.04'] | ||
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1'] | ||
|
||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
coverage: none | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: | | ||
echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Cache Files | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
${{ steps.composer-cache.outputs.dir }} | ||
**/.php_cs.cache | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install dependencies | ||
if: steps.composer-cache.outputs.cache-hit != 'true' | ||
run: composer install --prefer-dist --no-progress --no-suggest | ||
|
||
- name: Run tests | ||
run: ./vendor/bin/phpunit --testdox --stop-on-failure | ||
|
||
coverage: | ||
name: Coverage | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
matrix: | ||
operating-system: ['ubuntu-20.04'] | ||
php-versions: ['8.0'] | ||
|
||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
coverage: xdebug | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: | | ||
echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Cache Files | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
${{ steps.composer-cache.outputs.dir }} | ||
**/.php_cs.cache | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install dependencies | ||
if: steps.composer-cache.outputs.cache-hit != 'true' | ||
run: composer install --prefer-dist --no-progress --no-suggest | ||
|
||
- name: Run tests | ||
uses: paambaati/codeclimate-action@v2.7.2 | ||
env: | ||
CC_TEST_REPORTER_ID: "945dfb58a832d233a3caeb84e3e6d3be212e8c7abcb48117fce63b9adcb43647" | ||
with: | ||
coverageCommand: ./vendor/bin/phpunit --testdox --stop-on-failure --coverage-clover=clover.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
vendor/ | ||
composer.lock | ||
*.phar | ||
.php_cs.cache | ||
.php-cs-fixer.cache | ||
coverage/ | ||
psalm/cache/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/* | ||
* This document has been generated with | ||
* https://mlocati.github.io/php-cs-fixer-configurator/#version:3.0.0-rc.1|configurator | ||
* you can change this configuration by importing this file. | ||
*/ | ||
return (new PhpCsFixer\Config()) | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'@PHP71Migration' => true, // @PHP72Migration does not exist | ||
'@PHP71Migration:risky' => true, // @PHP72Migration:risky does not exist | ||
'array_syntax' => ['syntax' => 'short'], | ||
'declare_strict_types' => true, | ||
'global_namespace_import' => [ | ||
'import_classes' => true, | ||
'import_constants' => true, | ||
'import_functions' => false, | ||
], | ||
'native_constant_invocation' => true, | ||
'native_function_invocation' => [ | ||
'strict' => false, | ||
'include' => ['@compiler_optimized'], | ||
], | ||
'no_superfluous_phpdoc_tags' => true, | ||
'ordered_class_elements' => true, | ||
'ordered_imports' => true, | ||
'php_unit_dedicate_assert' => ['target' => 'newest'], | ||
'php_unit_method_casing' => true, | ||
'php_unit_test_case_static_method_calls' => ['call_type' => 'this'], | ||
'phpdoc_to_comment' => false, | ||
'void_return' => true, | ||
]) | ||
->setFinder(PhpCsFixer\Finder::create() | ||
->exclude('vendor') | ||
->in(__DIR__) | ||
) | ||
; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"symbol-whitelist" : [ | ||
"null", "true", "false", | ||
"static", "self", "parent", | ||
"array", "string", "int", "float", "bool", "iterable", "callable", "void", "object", "mixed", "never", | ||
"IMAP\\Connection" | ||
], | ||
"php-core-extensions" : [ | ||
"Core", | ||
"date", | ||
"pcre", | ||
"Phar", | ||
"Reflection", | ||
"SPL", | ||
"standard" | ||
], | ||
"scan-files" : [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.