-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (37 loc) · 1.4 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
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- master
pull_request:
types: [ opened, labeled, synchronize ]
name: Inspections
jobs:
runPHPCSInspection:
if: contains(github.event.pull_request.labels.*.name, 'run analysis')
name: Run PHPCS inspection
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Check PHPCS
run: |
export PHPCS_DIR=/home/runner/.composer/vendor/bin
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer global require --dev wp-coding-standards/wpcs:"^3.0"
$PHPCS_DIR/phpcs -p -s -v -n . --standard=phpcs.xml --extensions=php
- name: Check PHP syntax
run: find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
# get the PHP version
- uses: shivammathur/setup-php@v2
with:
php-version: 5.6
- name: Check Syntax
run: find -L . -path ./vendor -prune -o -path ./tests -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
# get the PHP version
- uses: shivammathur/setup-php@v2
with:
php-version: 8.0
- name: Check Syntax
run: find -L . -path ./vendor -prune -o -path ./tests -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l