deep-web-solutions/wordpress-framework-bootstrapper

View on GitHub
.github/workflows/php-syntax-errors.yml

Summary

Maintainability
Test Coverage
name: PHP Syntax Errors

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    strategy:
      matrix:
        php: [ 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 ]

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Setup proper PHP version
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}

      - name: Check all files for syntax errors
        if: ${{ matrix.php >= 7.2 }}
        run: find -L $GITHUB_WORKSPACE -path $GITHUB_WORKSPACE/vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l

      - name: Check all non-test files for syntax errors
        if: ${{ matrix.php < 7.2 }}
        run: find -L $GITHUB_WORKSPACE \( -path $GITHUB_WORKSPACE/vendor -o -path $GITHUB_WORKSPACE/tests \) -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l