Skip to content

Commit ed37784

Browse files
committed
Github phpcs workflow
1 parent 6721357 commit ed37784

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/phpcs.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: PHP Code Sniffer
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
phpcs:
11+
name: Run PHPCS
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
php-version: ['8.1', '8.2', '8.3']
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-version }}
26+
coverage: none
27+
28+
- name: Validate composer.json and composer.lock
29+
run: composer validate --strict
30+
31+
- name: Cache Composer dependencies
32+
uses: actions/cache@v3
33+
with:
34+
path: /tmp/composer-cache
35+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-php-${{ matrix.php-version }}-composer-
38+
39+
- name: Install dependencies
40+
run: composer install --prefer-dist --no-progress --no-interaction
41+
42+
- name: Run PHPCS
43+
run: vendor/bin/phpcs
44+

0 commit comments

Comments
 (0)