1
0
mirror of https://github.com/dannyvankooten/AltoRouter.git synced 2025-08-06 16:36:43 +02:00

check php syntax on all supported versions

This commit is contained in:
Danny van Kooten
2025-01-05 21:30:35 +01:00
parent 36f67da100
commit 9d62094f74
3 changed files with 24 additions and 3 deletions

20
.github/workflows/php-check-syntax.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: Check PHP syntax
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['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 }}
- name: checkout repo
uses: actions/checkout@v3
- run: composer run check-syntax

View File

@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '7.3', '8.0', '8.3' ]
php-versions: [ '7.3', 'highest' ]
steps:
- uses: actions/checkout@v2
@@ -33,7 +33,7 @@ jobs:
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress
run: composer install --no-progress
- name: Run test suite
run: composer run-script test

View File

@@ -30,6 +30,7 @@
"classmap": ["AltoRouter.php"]
},
"scripts": {
"test": "vendor/bin/phpunit"
"test": "vendor/bin/phpunit",
"check-syntax": "find . -name '*.php' -not -path './vendor/*' -print0 | xargs -0 -n1 php -l"
}
}