From 1540e250262650857198c0b1381771ce2f948b7b Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Fri, 20 Aug 2021 18:12:57 +0200 Subject: [PATCH 1/2] Use github action --- .gitattributes | 1 - .github/workflows/lint.yml | 16 +++++++++++++ .github/workflows/tests.yml | 6 +---- .styleci.yml | 46 ------------------------------------- readme.md | 1 - 5 files changed, 17 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/lint.yml delete mode 100644 .styleci.yml diff --git a/.gitattributes b/.gitattributes index a2b426bbb8..0a07e7e0f3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,7 +3,6 @@ /.gitignore export-ignore /.multi-tester.yml export-ignore /.php-cs-fixer.dist.php export-ignore -/.styleci.yml export-ignore /.travis.yml export-ignore /build.php export-ignore /contributing.md export-ignore diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..b8aae577ea --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,16 @@ +name: Linting + +on: [ pull_request, push ] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout the code + uses: actions/checkout@v2 + + - name: Check for code style violation with PHP-CS-Fixer + uses: OskarStark/php-cs-fixer-ga@3.0.0 + with: + args: --diff --dry-run diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e6e40c271e..d46cbb0eb4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,10 +1,6 @@ name: Tests -on: - push: - branches: [ '**' ] - pull_request: - branches: [ '**' ] +on: [ pull_request, push ] jobs: ubuntu: diff --git a/.styleci.yml b/.styleci.yml deleted file mode 100644 index 9b1e21dff8..0000000000 --- a/.styleci.yml +++ /dev/null @@ -1,46 +0,0 @@ -preset: psr2 - -risky: true - -enabled: - - concat_without_spaces - - extra_empty_lines - - is_null - - method_separation - - modernize_types_casting - - multiline_array_trailing_comma - - no_empty_lines_after_phpdocs - - operators_spaces - - ordered_use - - phpdoc_indent - - phpdoc_inline_tag - - phpdoc_no_access - - phpdoc_no_package - - phpdoc_order - - phpdoc_scalar - - phpdoc_separation - - phpdoc_to_comment - - phpdoc_trim - - phpdoc_type_to_var - - phpdoc_types - - phpdoc_var_without_name - - return - - short_array_syntax - - short_bool_cast - - single_quote - - spaces_after_semicolon - - spaces_cast - - standardize_not_equal - - ternary_spaces - - trim_array_spaces - - unalign_double_arrow - - unalign_equals - - unary_operators_spaces - - unneeded_control_parentheses - - unused_use - - whitespacy_lines - -finder: - not-path: - - "src/Carbon/Doctrine/DateTimeImmutableType.php" - - "src/Carbon/Doctrine/DateTimeType.php" diff --git a/readme.md b/readme.md index 70279c1ecb..a13ff5a7e1 100644 --- a/readme.md +++ b/readme.md @@ -3,7 +3,6 @@ [![Latest Stable Version](https://img.shields.io/packagist/v/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon) [![Total Downloads](https://img.shields.io/packagist/dt/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon) [![GitHub Actions](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fbriannesbitt%2FCarbon%2Fbadge&style=flat-square&label=Build&logo=none)](https://actions-badge.atrox.dev/briannesbitt/Carbon/goto) -[![StyleCI](https://github.styleci.io/repos/5724990/shield?style=flat-square)](https://github.styleci.io/repos/5724990) [![codecov.io](https://img.shields.io/codecov/c/github/briannesbitt/Carbon.svg?style=flat-square)](https://codecov.io/github/briannesbitt/Carbon?branch=master) [![PHPStan](https://img.shields.io/badge/PHPStan-enabled-44CC11.svg?longCache=true&style=flat-square)](https://github.com/phpstan/phpstan) [![Tidelift](https://tidelift.com/badges/github/briannesbitt/Carbon)](https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme) From bf895095d0a5bbba8f689ca8df6a104f7d813f05 Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Sun, 22 Aug 2021 19:28:10 +0200 Subject: [PATCH 2/2] No need to run phpcs during testing --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index fe8e4697e6..eaae08de3f 100644 --- a/composer.json +++ b/composer.json @@ -82,7 +82,6 @@ "phpstan": "phpstan analyse --configuration phpstan.neon", "phpunit": "phpunit --verbose", "style-check": [ - "@phpcs", "@phpstan", "@phpmd" ],