Skip to content

Commit 25a0f26

Browse files
committed
Add CS check to build
1 parent be0547b commit 25a0f26

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/check-style.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Check Codestyle
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- "*"
10+
# Allow manually triggering the workflow.
11+
workflow_dispatch:
12+
13+
# Cancels all previous workflow runs for the same branch that have not yet completed.
14+
concurrency:
15+
# The concurrency group contains the workflow name and the branch name.
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
fix-style:
21+
name: Fix Code Style
22+
timeout-minutes: 15
23+
runs-on: ubuntu-latest
24+
env:
25+
COMPOSER_NO_INTERACTION: 1
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v3
30+
31+
- name: Setup PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: 8.x
35+
coverage: none
36+
tools: composer, cs2pr
37+
38+
- name: Install dependencies
39+
run: |
40+
composer update --prefer-dist --no-suggest --no-progress --no-interaction
41+
- name: Check Code Style
42+
run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml
43+
44+
- name: Show PHPCS results in PR
45+
run: cs2pr ./phpcs-report.xml
46+

0 commit comments

Comments
 (0)