Skip to content

Commit b5956d6

Browse files
staabmclxmstaab
andauthored
Added code-style checking github action (#90)
Co-authored-by: Markus Staab <[email protected]>
1 parent c614e71 commit b5956d6

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/code-style.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Code Style
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
php-cs-fixer:
11+
runs-on: ubuntu-latest
12+
if: github.event.pull_request.draft == false
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
18+
ref: ${{ github.event.client_payload.pull_request.head.ref }}
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: 8.1
24+
coverage: none # disable xdebug, pcov
25+
tools: cs2pr
26+
27+
- name: Composer install
28+
uses: ramsey/composer-install@v2
29+
with:
30+
composer-options: --ansi --prefer-dist
31+
32+
- name: Check code style
33+
run: vendor/bin/php-cs-fixer fix --ansi --diff --dry-run --format=checkstyle | cs2pr # check whether there are still errors left

0 commit comments

Comments
 (0)