github-actions-magento2 icon indicating copy to clipboard operation
github-actions-magento2 copied to clipboard

[FEAT] Magento Coding Standards / PHP Compatibility tests

Open ihor-sviziev opened this issue 3 years ago • 4 comments
trafficstars

:bulb: Feature request

Feature Name

Run Magento Coding Standards on top of my module(s)

The Desired Behavior

I'd like to have the ability to run the Magento Coding Standards static test for my module from the module' or from the project's repository. In addition to that, I'd like to select the Coding Standard version.

Also, I would like to have the ability to run PHP compatibility tests.

https://github.com/magento/magento-coding-standard https://github.com/PHPCompatibility/PHPCompatibility

Note: here are the examples: https://github.com/extdn/github-actions-m2/tree/master/magento-coding-standard https://github.com/extdn/github-actions-m2/tree/master/magento-copy-paste-detector https://github.com/extdn/github-actions-m2/tree/master/magento-mess-detector https://github.com/extdn/github-actions-m2/tree/master/magento-phpstan https://github.com/extdn/github-actions-m2/tree/master/php-compatibility

They are based on docker and do not support configuring the standard coding version, for instance.

TODO:

  • [x] Run PHPCS on top of magento-coding-standard
  • [ ] Run PHPCS for PHP compatibility
  • [ ] Run PhpStan
  • [ ] Run PHPMD
  • [ ] Run Copy-Paste detector

Your Use Case

Prior Work

Environment


Magento version: X.Y.Z 
PHP Version version: X.Y.Z 


Others:

ihor-sviziev avatar Aug 05 '22 13:08 ihor-sviziev

@ihor-sviziev could you outline a potential YAML file you'd like to see for such an action? Would you prefer a workflow or an action?

damienwebdev avatar Aug 05 '22 13:08 damienwebdev

Partially fixed by #51 @ihor-sviziev can you give this a try?

damienwebdev avatar Sep 06 '22 14:09 damienwebdev

@damienwebdev I just checked - in general looks good. The only thing is missing for me - ability to add additional phpcs params, for instance --ignore='*/js/lib/*'

Also, on PRs would be great to add a comments like in https://github.com/chekalsky/phpcs-action

ihor-sviziev avatar Oct 07 '22 08:10 ihor-sviziev

@ihor-sviziev moving that to a separate issue.

damienwebdev avatar Oct 11 '22 20:10 damienwebdev

Closing in favor of https://github.com/mage-os/github-actions/issues/10

damienwebdev avatar Apr 25 '23 13:04 damienwebdev