Skip to content

Commit

Permalink
check php syntax on all supported versions
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvankooten committed Jan 6, 2025
1 parent 45b0313 commit 49ea9c1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/php-check-syntax.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check PHP syntax

on: [ push, pull_request ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', 'highest']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer

- name: checkout repo
uses: actions/checkout@v3

- run: composer run check-syntax
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
},
"scripts": {
"check-syntax": "find . -name '*.php' -not -path './vendor/*' -not -path './node_modules/*' -print0 | xargs -0 -n1 php -l"
}
}

0 comments on commit 49ea9c1

Please sign in to comment.