-
-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (40 loc) · 1.46 KB
/
Copy pathphpcs.yml
File metadata and controls
50 lines (40 loc) · 1.46 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: PHPCS
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
concurrency:
# Cancel superseded PR runs to save CI minutes; let push/main runs finish so
# main is always validated directly (catches anything pushed straight to main).
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
env:
PHP_VERSION: "8.4"
jobs:
check-phpcs:
name: PHPCS
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up PHP
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2
with:
php-version: ${{ env.PHP_VERSION }}
tools: composer:v2
- name: Cache Composer packages
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.composer/cache/files
key: ${{ runner.os }}-composer-phpcs-${{ hashFiles('composer.json') }}
restore-keys: ${{ runner.os }}-composer-phpcs
# The coding standard is a require-dev dependency of the module, so CI and
# local development (ddev phpcs) use the same pinned tool versions.
- name: Install dev dependencies
run: composer install --no-interaction --no-progress
# Standard and file list come from phpcs.xml.dist
- name: Run PHPCS
run: vendor/bin/phpcs -p -s