Skip to content

Commit

Permalink
check php syntax on all supported PHP versions
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvankooten committed Jan 5, 2025
1 parent dfa8541 commit a3900b0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/check-php-syntax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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', '8.4']
steps:
# Install PHP interpreter
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}

# Checkout source repository
- name: checkout repo
uses: actions/checkout@v3

# Lint every PHP source file using PHP interpreter
- run: composer run check-syntax
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"scripts": {
"test": "php vendor/bin/phpunit --bootstrap tests/bootstrap.php tests/",
"check-syntax": "find . -name '*.php' -not -path './vendor/*' -not -path './var/cache/*' -print0 | xargs -0 -n1 php -l",
"lint": "vendor/bin/phpcs -n -s",
"fmt": "vendor/bin/phpcbf"
}
Expand Down

0 comments on commit a3900b0

Please sign in to comment.