-
Notifications
You must be signed in to change notification settings - Fork 221
50 lines (42 loc) · 1.22 KB
/
Copy pathphpcs.yml
File metadata and controls
50 lines (42 loc) · 1.22 KB
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
40
41
42
43
44
45
46
47
48
49
50
name: Static Analysis (PHP Linting)
on:
pull_request:
paths:
- '**.php'
- phpcs.xml.dist
- composer.json
- .github/workflows/phpcs.yml
- .github/bin/phpcs-branch.php
push:
branches: [trunk]
paths:
- '**.php'
# Cancel superseded PR runs; trunk pushes get per-commit groups so queued mirrored commits aren't cancelled.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'push' && github.sha || '' }}
cancel-in-progress: true
jobs:
phpcs:
name: PHP Coding Standards
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: none
tools: composer:v2
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Composer dependencies
uses: actions/cache@v6
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
- name: Install Composer dependencies
run: composer install --no-interaction --prefer-dist
- name: Lint PHP
run: BASE_REF=${{ github.base_ref }} php .github/bin/phpcs-branch.php