Skip to content

Commit 4ad3256

Browse files
check php syntax on all supported versions
1 parent 4f7e0a2 commit 4ad3256

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ insert_final_newline = true
1313
trim_trailing_whitespace = true
1414
indent_style = tab
1515

16-
[*.yml]
16+
[*.{yaml,yml}]
1717
indent_style = space
1818
indent_size = 2
1919

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Check PHP syntax
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
11+
steps:
12+
# Install PHP interpreter
13+
- name: Setup PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: ${{ matrix.php-versions }}
17+
18+
# Checkout source repository
19+
- name: checkout repo
20+
uses: actions/checkout@v3
21+
22+
# Lint every PHP source file using PHP interpreter
23+
- run: composer run check-syntax

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
],
1515
"require": {
1616
"php": ">=7.2"
17+
},
18+
"scripts": {
19+
"check-syntax": "find . -name '*.php' -not -path './vendor/*' -not -path './node_modules/*' -print0 | xargs -0 -n1 php -l"
1720
}
1821
}

0 commit comments

Comments
 (0)