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 cf91374 commit ef6d43a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 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
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.2', '8.3' ]
php-versions: [ '8.3' ]
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"scripts": {
"make-pot": "wp i18n make-pot . languages/mailchimp-for-wp.pot --exclude=assets/js",
"test": "phpunit tests/",
"codestyle": "phpcs -n -s"
"codestyle": "phpcs -n -s",
"check-syntax": "find . -name '*.php' -not -path './vendor/*' -not -path './var/cache/*' -print0 | xargs -0 -n1 php -l"
},
"config": {
"allow-plugins": {
Expand Down

0 comments on commit ef6d43a

Please sign in to comment.