-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new github actions, and appy fixes style-ci and ECS
PERCS20
sty…
…le. (#66)
- Loading branch information
1 parent
16da67d
commit 5c66ab7
Showing
27 changed files
with
461 additions
and
175 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
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,10 +1,39 @@ | ||
# Ignore all test and documentation for archive | ||
/.editorconfig export-ignore | ||
/.github export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.scrutinizer.yml export-ignore | ||
/.travis.yml export-ignore | ||
/phpunit.xml.dist export-ignore | ||
/tests export-ignore | ||
/docs export-ignore | ||
# Autodetect text files | ||
* text=auto eol=lf | ||
|
||
# ...Unless the name matches the following overriding patterns | ||
|
||
# Definitively text files | ||
*.php text | ||
*.css text | ||
*.js text | ||
*.txt text | ||
*.md text | ||
*.xml text | ||
*.json text | ||
*.bat text | ||
*.sql text | ||
*.yml text | ||
|
||
# Ensure those won't be messed up with | ||
*.png binary | ||
*.jpg binary | ||
*.gif binary | ||
*.ttf binary | ||
|
||
# Avoid merge conflicts in CHANGELOG | ||
# https://about.gitlab.com/2015/02/10/gitlab-reduced-merge-conflicts-by-90-percent-with-changelog-placeholders/ | ||
/CHANGELOG.md merge=union | ||
|
||
# Exclude files from the archive | ||
/.gitattributes export-ignore | ||
/.github export-ignore | ||
/.gitignore export-ignore | ||
/.styleci.yml export-ignore | ||
/codeception.yml export-ignore | ||
/composer-require-checker.json export-ignore | ||
/docs export-ignore | ||
/phpunit.xml.dist export-ignore | ||
/psalm.xml export-ignore | ||
/rector.php export-ignore | ||
/tests export-ignore |
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,49 +1,32 @@ | ||
name: build | ||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- 'infection.json.dist' | ||
- 'psalm.xml' | ||
|
||
on: [push, pull_request] | ||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- 'infection.json.dist' | ||
- 'psalm.xml' | ||
|
||
env: | ||
DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi" | ||
name: build | ||
|
||
jobs: | ||
phpunit: | ||
name: PHP ${{ matrix.php }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
php: ['8.1', '8.2'] | ||
|
||
steps: | ||
- name: Install sendmail | ||
run: sudo apt-get install -y sendmail | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: pcov | ||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Cache composer dependencies | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer-${{ matrix.php }}- | ||
- name: Install dependencies | ||
run: composer update $DEFAULT_COMPOSER_FLAGS | ||
- name: Install logging proxy | ||
if: ${{ matrix.php != '7.4' }} | ||
run: composer require "yiisoft/yii2-psr-log-source" | ||
- name: Run unit tests with coverage | ||
run: vendor/bin/phpunit --coverage-text | ||
- name: Static analysis (Psalm) | ||
run: vendor/bin/psalm | ||
- name: Static analysis (phpstan) | ||
run: vendor/bin/phpstan | ||
- name: Test code style | ||
run: vendor/bin/ecs | ||
phpunit: | ||
uses: yiisoft/actions/.github/workflows/phpunit.yml@master | ||
with: | ||
composer-command: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi --ignore-platform-req=php+ | ||
os: >- | ||
['ubuntu-latest'] | ||
php: >- | ||
['8.1', '8.2', '8.3'] |
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,33 @@ | ||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- 'infection.json.dist' | ||
- 'phpunit.xml.dist' | ||
- 'psalm.xml' | ||
|
||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- 'infection.json.dist' | ||
- 'phpunit.xml.dist' | ||
- 'psalm.xml' | ||
|
||
name: dependency-check | ||
|
||
jobs: | ||
composer-require-checker: | ||
uses: yiisoft/actions/.github/workflows/composer-require-checker.yml@master | ||
with: | ||
os: >- | ||
['ubuntu-latest'] | ||
php: >- | ||
['8.1'] |
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,31 @@ | ||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- 'infection.json.dist' | ||
- 'phpunit.xml.dist' | ||
|
||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- 'infection.json.dist' | ||
- 'phpunit.xml.dist' | ||
|
||
name: ecs | ||
|
||
jobs: | ||
easy-coding-standard: | ||
uses: yiisoft/actions/.github/workflows/ecs.yml@master | ||
with: | ||
os: >- | ||
['ubuntu-latest'] | ||
php: >- | ||
['8.1'] |
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,32 @@ | ||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- 'psalm.xml' | ||
|
||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- 'psalm.xml' | ||
|
||
name: mutation test | ||
|
||
jobs: | ||
mutation: | ||
uses: yiisoft/actions/.github/workflows/roave-infection.yml@master | ||
secrets: | ||
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} | ||
with: | ||
extensions: runkit7 | ||
os: >- | ||
['ubuntu-latest'] | ||
php: >- | ||
['8.1'] |
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,31 @@ | ||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- 'infection.json.dist' | ||
- 'phpunit.xml.dist' | ||
|
||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- 'infection.json.dist' | ||
- 'phpunit.xml.dist' | ||
|
||
name: static analysis | ||
|
||
jobs: | ||
psalm: | ||
uses: yiisoft/actions/.github/workflows/psalm.yml@master | ||
with: | ||
os: >- | ||
['ubuntu-latest'] | ||
php: >- | ||
['8.1'] |
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,87 @@ | ||
preset: psr12 | ||
risky: true | ||
|
||
version: 8.1 | ||
|
||
finder: | ||
exclude: | ||
- docs | ||
- vendor | ||
|
||
enabled: | ||
- alpha_ordered_traits | ||
- array_indentation | ||
- array_push | ||
- combine_consecutive_issets | ||
- combine_consecutive_unsets | ||
- combine_nested_dirname | ||
- declare_strict_types | ||
- dir_constant | ||
- empty_loop_body_braces | ||
- fully_qualified_strict_types | ||
- function_to_constant | ||
- hash_to_slash_comment | ||
- integer_literal_case | ||
- is_null | ||
- logical_operators | ||
- magic_constant_casing | ||
- magic_method_casing | ||
- method_separation | ||
- modernize_types_casting | ||
- native_function_casing | ||
- native_function_type_declaration_casing | ||
- no_alias_functions | ||
- no_empty_comment | ||
- no_empty_phpdoc | ||
- no_empty_statement | ||
- no_extra_block_blank_lines | ||
- no_short_bool_cast | ||
- no_superfluous_elseif | ||
- no_unneeded_control_parentheses | ||
- no_unneeded_curly_braces | ||
- no_unneeded_final_method | ||
- no_unset_cast | ||
- no_unused_imports | ||
- no_unused_lambda_imports | ||
- no_useless_else | ||
- no_useless_return | ||
- normalize_index_brace | ||
- php_unit_dedicate_assert | ||
- php_unit_dedicate_assert_internal_type | ||
- php_unit_expectation | ||
- php_unit_mock | ||
- php_unit_mock_short_will_return | ||
- php_unit_namespaced | ||
- php_unit_no_expectation_annotation | ||
- phpdoc_no_empty_return | ||
- phpdoc_no_useless_inheritdoc | ||
- phpdoc_order | ||
- phpdoc_property | ||
- phpdoc_scalar | ||
- phpdoc_singular_inheritdoc | ||
- phpdoc_trim | ||
- phpdoc_trim_consecutive_blank_line_separation | ||
- phpdoc_type_to_var | ||
- phpdoc_types | ||
- phpdoc_types_order | ||
- print_to_echo | ||
- regular_callable_call | ||
- return_assignment | ||
- self_accessor | ||
- self_static_accessor | ||
- set_type_to_cast | ||
- short_array_syntax | ||
- short_list_syntax | ||
- simplified_if_return | ||
- single_quote | ||
- standardize_not_equals | ||
- ternary_to_null_coalescing | ||
- trailing_comma_in_multiline_array | ||
- unalign_double_arrow | ||
- unalign_equals | ||
- union_type_without_spaces | ||
|
||
disabled: | ||
- function_declaration | ||
- psr12_braces | ||
- psr12_class_definition |
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,5 @@ | ||
{ | ||
"symbol-whitelist": [ | ||
"yii\\psr\\DynamicLogger" | ||
] | ||
} |
Oops, something went wrong.