diff --git a/.github/workflows/php-check-syntax.yml b/.github/workflows/php-check-syntax.yml new file mode 100644 index 0000000..edf16c3 --- /dev/null +++ b/.github/workflows/php-check-syntax.yml @@ -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 diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 1ddd9ac..acd5e2f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -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 diff --git a/composer.json b/composer.json index d10314c..e98cda4 100644 --- a/composer.json +++ b/composer.json @@ -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" } }