rector/docs/checkstyle.md

36 lines
1007 B
Markdown
Raw Normal View History

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
# .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
- 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
```