-
Notifications
You must be signed in to change notification settings - Fork 3
39 lines (32 loc) · 1.02 KB
/
phpcs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: PHPCS on Push
on:
push:
branches:
- '*'
jobs:
phpcs:
name: Run PHPCS
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v4
# Set up PHP with Composer
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1' # Specify the version of PHP you want to use
tools: composer, phpcs
# Install Composer dependencies, including dev dependencies
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --no-interaction
# Run PHPCS (PHP CodeSniffer) to check code standards
- name: Run PHP CodeSniffer
run: vendor/bin/phpcs -ps .
# Optional: Fail the workflow if PHPCS finds issues
- name: Fail if issues found
run: |
if [ $(vendor/bin/phpcs --report=summary . | grep -c "FOUND") -gt 0 ]; then
echo "PHPCS found issues, failing the job."
exit 1
fi