2020-04-23 23:01:12 +02:00
# How to Add Checkstyle to your CI?
[Checkstyle ](https://github.com/staabm/annotate-pull-request-from-checkstyle ) is feature for GitHub Actions to add comment right into your pull-request.
Save your time from looking into failed CI build, when you can see comment right in your pull-request.
## Add GitHub Actions Workflow
```yaml
2020-12-17 10:18:14 -05:00
# .github/workflows/rector_checkstyle.yaml
2020-04-23 23:01:12 +02:00
# see https://github.com/staabm/annotate-pull-request-from-checkstyle
name: Rector Checkstyle
on:
pull_request: null
push:
branches:
- master
jobs:
rector_checkstyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2020-11-27 13:23:25 +01:00
- uses: shivammathur/setup-php@v2
2020-04-23 23:01:12 +02:00
with:
php-version: 7.2
coverage: none
tools: cs2pr
2020-07-21 10:02:50 +02:00
- run: composer install --no-progress --ansi
2020-04-23 23:01:12 +02:00
2020-07-21 10:02:50 +02:00
- run: vendor/bin/rector process --ansi --dry-run --output-format=checkstyle | cs2pr
2020-04-23 23:01:12 +02:00
```