Skip to content

Commit f0b023f

Browse files
tristanbesstaabm
andauthored
Provide a better example on how to use the tool with shivammathur… (#12)
* Provide a better example on how to use the tool with shivammathur/setup-php Since they officially support `cs2pr` * fix typo * Update README.md Co-authored-by: Markus Staab <maggus.staab@googlemail.com>
1 parent 75f5947 commit f0b023f

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ you might instead try
7979

8080
## Example GithubAction workflow
8181

82+
83+
If you're using `shivammathur/setup-php` to setup PHP, `cs2pr` binary is shipped within:
84+
8285
```
8386
# ...
84-
8587
jobs:
8688
phpstan-analysis:
8789
name: phpstan static code analysis
@@ -93,6 +95,24 @@ jobs:
9395
with:
9496
php-version: 7.3
9597
coverage: none # disable xdebug, pcov
98+
tools: cs2pr
99+
- run: |
100+
composer install # install your apps dependencies
101+
vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr
102+
```
103+
104+
If you're use a custom PHP installation, then your project needs to require `staabm/annotate-pull-request-from-checkstyle`
105+
106+
```
107+
# ...
108+
jobs:
109+
phpstan-analysis:
110+
name: phpstan static code analysis
111+
runs-on: ubuntu-latest
112+
steps:
113+
- uses: actions/checkout@v2
114+
- name: Setup PHP
115+
run: # custom PHP installation
96116
- run: |
97117
composer install # install your apps dependencies
98118
composer require staabm/annotate-pull-request-from-checkstyle # install cs2pr

0 commit comments

Comments
 (0)