From 6ca549dcaab6cb03b024d1a43ed2b6835dbae827 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Mon, 3 Feb 2020 03:26:06 +0530 Subject: [PATCH] Update readme --- README.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3060eb54..f5598e4d 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support These tools can be setup globally using the `tools` input. -`codeception`, `composer`, `composer-prefetcher`, `deployer`, `pecl`, `phinx`, `phive`, `phpcbf`, `phpcpd`, `php-config`, `php-cs-fixer`, `phpcs`, `phpize`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `psalm`, `symfony` +`codeception`, `composer`, `composer-prefetcher`, `cs2pr`, `deployer`, `pecl`, `phinx`, `phive`, `phpcbf`, `phpcpd`, `php-config`, `php-cs-fixer`, `phpcs`, `phpize`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `psalm`, `symfony` ```yaml uses: shivammathur/setup-php@v1 @@ -115,7 +115,7 @@ with: ### PCOV -Specify `coverage: pcov` to use `PCOV`. +Specify `coverage: pcov` to use `PCOV` and disable `Xdebug`. It is much faster than `Xdebug`. `PCOV` needs `PHP >= 7.1`. If your source code directory is other than `src`, `lib` or, `app`, specify `pcov.directory` using the `ini-values` input. @@ -281,6 +281,8 @@ key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} ### Problem Matchers +#### PHPUnit + You can setup problem matchers for your `PHPUnit` output by adding this step after the `setup-php` step. This will scan the logs for failing tests and surface that information prominently in the GitHub Actions UI by creating annotations and log file decorations. ```yaml @@ -288,6 +290,24 @@ You can setup problem matchers for your `PHPUnit` output by adding this step aft run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" ``` +#### Other tools + +For tools that support `checkstyle` reporting like `phpstan`, `psalm`, `php-cs-fixer` and `phpcs` you can use `cs2pr` to annotate your code. +For examples refer to [cs2pr documentation](https://github.com/staabm/annotate-pull-request-from-checkstyle). + +> Here is an example with `phpstan`. + +```yaml +- name: Setup PHP + uses: shivammathur/setup-php@v1 + with: + php-version: '7.4' + tools: cs2pr, phpstan + +- name: PHPStan + run: phpstan analyse src --error-format=checkstyle | cs2pr +``` + ### Examples Examples for setting up this GitHub Action with different PHP Frameworks/Packages.