Skip to content

Commit 49ea9c1

Browse files
check php syntax on all supported versions
1 parent 45b0313 commit 49ea9c1

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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', 'highest']
11+
steps:
12+
- name: Setup PHP
13+
uses: shivammathur/setup-php@v2
14+
with:
15+
php-version: ${{ matrix.php-versions }}
16+
tools: composer
17+
18+
- name: checkout repo
19+
uses: actions/checkout@v3
20+
21+
- run: composer run check-syntax

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,8 @@
3030
"allow-plugins": {
3131
"dealerdirect/phpcodesniffer-composer-installer": true
3232
}
33-
}
33+
},
34+
"scripts": {
35+
"check-syntax": "find . -name '*.php' -not -path './vendor/*' -not -path './node_modules/*' -print0 | xargs -0 -n1 php -l"
36+
}
3437
}

0 commit comments

Comments
 (0)