Repository navigation
38 lines (35 loc) · 1.94 KB
/
Copy pathsyntax.yml
File metadata and controls
38 lines (35 loc) · 1.94 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
on:
pull_request:
types: [ opened, labeled, synchronize ]
name: PHP Syntax Check
# Cancel superseded runs for the same branch. The group is named explicitly
# rather than derived from github.workflow: several files share the workflow
# name `Inspections` and would otherwise cancel each other.
concurrency:
group: formidable-syntax-${{ github.ref }}-${{ ((contains(github.event.pull_request.labels.*.name, 'run analysis') || contains(github.event.pull_request.labels.*.name, 'full automated qa')) && (github.event.action != 'labeled' || github.event.label.name == 'run analysis' || github.event.label.name == 'full automated qa')) && 'active' || github.run_id }}
cancel-in-progress: true
jobs:
runPHPSyntaxCheck:
if: >-
(contains(github.event.pull_request.labels.*.name, 'run analysis') || contains(github.event.pull_request.labels.*.name, 'full automated qa'))
&& (github.event.action != 'labeled' || github.event.label.name == 'run analysis' || github.event.label.name == 'full automated qa')
name: Run PHP Syntax inspection
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: 7.0
- php: 8.4
steps:
- uses: actions/checkout@v4.1.1
- uses: shivammathur/setup-php@2.36.0
with:
php-version: ${{ matrix.php }}
- name: Check PHP ${{ matrix.multisite }} syntax
# lib/vendor is pruned as well as vendor: the vendored MCP adapter and
# schema packages use PHP 7.4 syntax, so they do not parse on the 7.0
# leg of this matrix. That is expected rather than a defect — Formidable
# itself still supports 7.0, and FrmMcpCompat refuses to load the
# adapter below PHP 7.4 (FrmMcpCompat::MIN_PHP_ID), so none of those
# files is ever parsed on a PHP that cannot read them.
run: find -L . -path ./vendor -prune -o -path ./lib/vendor -prune -o -path ./tests -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l