-
Notifications
You must be signed in to change notification settings - Fork 67
54 lines (46 loc) · 1.28 KB
/
php-coding-standards.yml
File metadata and controls
54 lines (46 loc) · 1.28 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
51
52
53
54
name: PHP Coding Standards
on:
push:
branches:
- trunk
paths:
- "**.php"
- .github/workflows/php-coding-standards.yml
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-paths:
name: Check changed files
runs-on: ubuntu-latest
outputs:
should-run: ${{ steps.changes.outputs.php }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check for relevant changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
php:
- '**.php'
- '.github/workflows/php-coding-standards.yml'
phpcs:
name: PHP coding standards
runs-on: ubuntu-latest
needs: check-paths
if: needs.check-paths.outputs.should-run == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare PHP
uses: woocommerce/grow/prepare-php@actions-v2
with:
php-version: 7.4
tools: cs2pr
- name: Log PHPCS debug information
run: vendor/bin/phpcs -i
- name: Run PHPCS on all files
run: vendor/bin/phpcs ./* -q --report=checkstyle | cs2pr