-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (52 loc) · 1.22 KB
/
Copy pathphp.yml
File metadata and controls
63 lines (52 loc) · 1.22 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
55
56
57
58
59
60
61
62
63
name: PHP Compatibility
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
permissions:
contents: read
jobs:
php-lint:
name: PHP ${{ matrix.php }} Syntax Check
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 repository
uses: actions/checkout@v5
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: none
- name: Show PHP version
run: php --version
- name: Check PHP syntax
shell: bash
run: |
set -euo pipefail
echo "Running PHP syntax checks..."
find . \
-type f \
-name "*.php" \
-not -path "./vendor/*" \
-not -path "./node_modules/*" \
-print0 |
while IFS= read -r -d '' file; do
echo "Checking: ${file}"
php -l "${file}"
done
echo "All PHP files passed syntax validation."