forked from Cacti/plugin_mactrack
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.14 KB
/
Copy pathphp-syntax.yml
File metadata and controls
52 lines (43 loc) · 1.14 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
name: PHP Syntax
on:
pull_request:
push:
branches:
- develop
permissions:
contents: read
concurrency:
group: php-syntax-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: PHP ${{ matrix.php }} syntax
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: none
coverage: none
- name: Show PHP version
run: php -v
- name: Guard against corrupted refactor patterns
run: |
set -euo pipefail
if grep -R -n -E '\b(is_|in_|call_user_func_|port_list_to_|mactrack_display_|mactrack_device_action_)\[' --include='*.php' .; then
echo "Detected corrupted call-pattern rewrite(s)." >&2
exit 1
fi
- name: Lint PHP files
run: |
set -euo pipefail
git ls-files '*.php' | while IFS= read -r f; do
php -l "$f"
done