Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Masiukevich Maksim
committed
Jan 3, 2021
1 parent
33a2f04
commit 9ab7177
Showing
32 changed files
with
253 additions
and
241 deletions.
There are no files selected for viewing
File renamed without changes.
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,134 @@ | ||
name: "Continuous Integration" | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
code-style: | ||
name: Code style | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.0 | ||
coverage: none | ||
tools: composer:v2 | ||
|
||
- name: Install dependencies with composer | ||
run: composer install -ov | ||
|
||
- name: Run php-cs-fixer | ||
run: PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run --using-cache=no --verbose | ||
|
||
psalm: | ||
name: Psalm | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.0 | ||
coverage: none | ||
tools: composer:v2 | ||
|
||
- name: Install dependencies with composer | ||
run: composer install -ov | ||
|
||
- name: Run vimeo/psalm | ||
run: ./vendor/bin/psalm --config=psalm.xml --shepherd | ||
|
||
phpstan: | ||
name: PHPStan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.0 | ||
coverage: none | ||
tools: composer:v2 | ||
|
||
- name: Install dependencies with composer | ||
run: composer install -ov | ||
|
||
- name: Run phpstan/phpstan | ||
run: ./vendor/bin/phpstan analyse src --level 7 | ||
|
||
phpunit: | ||
name: PHPUnit | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:13 | ||
env: | ||
POSTGRES_USER: test | ||
POSTGRES_PASSWORD: 123456789 | ||
POSTGRES_DB: test | ||
ports: | ||
- 5432:5432 | ||
options: --name=postgres --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
|
||
env: | ||
PHP_EXTENSIONS: dom, json, mbstring, curl, tokenizer, pdo_sqlite, pdo_pgsql, pdo | ||
PHP_INI_VALUES: assert.exception=1, zend.assertions=1 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Override PHP ini values for JIT compiler | ||
run: echo "PHP_INI_VALUES::assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=1, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M" >> $GITHUB_ENV | ||
|
||
- name: Install PHP with extensions | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.0 | ||
extensions: ${{ env.PHP_EXTENSIONS }} | ||
ini-values: ${{ env.PHP_INI_VALUES }} | ||
tools: composer:v2 | ||
|
||
- name: Install dependencies | ||
run: composer update --no-ansi --no-interaction --no-progress --prefer-lowest | ||
|
||
- name: Run tests with phpunit | ||
run: XDEBUG_MODE=coverage php ./vendor/bin/phpunit --configuration ./phpunit.xml --coverage-clover=coverage.clover | ||
|
||
- name: Upload coverage file | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: phpunit.coverage | ||
path: coverage.clover | ||
|
||
upload_coverage: | ||
name: Upload coverage | ||
runs-on: ubuntu-latest | ||
needs: phpunit | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
coverage: none | ||
tools: composer | ||
|
||
- name: Download coverage files | ||
uses: actions/download-artifact@v2 | ||
with: | ||
path: reports | ||
|
||
- name: Send code coverage report to Scrutinizer | ||
run: | | ||
wget https://scrutinizer-ci.com/ocular.phar | ||
php ocular.phar code-coverage:upload --format=php-clover ./reports/phpunit.coverage/coverage.clover |
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 |
---|---|---|
@@ -1,69 +1,21 @@ | ||
checks: | ||
php: true | ||
|
||
filter: | ||
paths: [src/*] | ||
excluded_paths: [tests/*] | ||
paths: | ||
- "src/*" | ||
|
||
tools: | ||
php_analyzer: true | ||
php_sim: true | ||
php_pdepend: true | ||
sensiolabs_security_checker: true | ||
php_changetracking: true | ||
php_mess_detector: | ||
enabled: true | ||
config: | ||
ruleset: ~ | ||
code_size_rules: | ||
cyclomatic_complexity: true | ||
npath_complexity: true | ||
excessive_method_length: true | ||
excessive_class_length: true | ||
excessive_parameter_list: true | ||
excessive_public_count: true | ||
too_many_fields: true | ||
too_many_methods: true | ||
excessive_class_complexity: true | ||
design_rules: | ||
exit_expression: true | ||
eval_expression: true | ||
goto_statement: true | ||
number_of_class_children: true | ||
depth_of_inheritance: true | ||
coupling_between_objects: true | ||
unused_code_rules: | ||
unused_private_field: true | ||
unused_local_variable: true | ||
unused_private_method: true | ||
unused_formal_parameter: true | ||
naming_rules: | ||
short_variable: | ||
minimum: 3 | ||
long_variable: | ||
maximum: 20 | ||
short_method: | ||
minimum: 3 | ||
constructor_conflict: true | ||
constant_naming: true | ||
boolean_method_name: true | ||
controversial_rules: | ||
superglobals: true | ||
camel_case_class_name: true | ||
camel_case_property_name: true | ||
camel_case_method_name: true | ||
camel_case_parameter_name: true | ||
camel_case_variable_name: true | ||
external_code_coverage: | ||
timeout: 600 | ||
checks: | ||
php: | ||
code_rating: true | ||
|
||
build: | ||
nodes: | ||
analysis: | ||
environment: | ||
php: | ||
version: 7.4.5 | ||
php: 8.0.0 | ||
project_setup: | ||
override: true | ||
tests: | ||
override: | ||
- php-scrutinizer-run --enable-security-analysis | ||
- php-scrutinizer-run --enable-security-analysis |
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
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 |
---|---|---|
@@ -1,36 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit bootstrap="vendor/autoload.php" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
beStrictAboutTestsThatDoNotTestAnything="false" | ||
colors="true" | ||
verbose="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
failOnRisky="true" | ||
failOnWarning="true" | ||
stopOnFailure="false"> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" | ||
backupStaticAttributes="false" beStrictAboutTestsThatDoNotTestAnything="false" colors="true" verbose="true" | ||
convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" | ||
failOnRisky="true" failOnWarning="true" stopOnFailure="false" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> | ||
<coverage> | ||
<include> | ||
<directory>./</directory> | ||
</include> | ||
<exclude> | ||
<directory>./tests</directory> | ||
<directory>./vendor</directory> | ||
</exclude> | ||
</coverage> | ||
<php> | ||
<ini name="error_reporting" value="-1"/> | ||
<env name="TEST_POSTGRES_DSN" value="pgsql://postgres:123456789@localhost:5432/test"/> | ||
<env name="TEST_POSTGRES_DSN" value="pgsql://test:123456789@localhost:5432/test"/> | ||
</php> | ||
|
||
<testsuites> | ||
|
||
<testsuite name="Common storage parts"> | ||
<testsuite name="PHP Service Bus storage component"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
|
||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>./</directory> | ||
<exclude> | ||
<directory>./tests</directory> | ||
<directory>./vendor</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
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.