lint.yml 937 B

123456789101112131415161718192021222324252627282930313233343536
  1. name: Lint PHP Code
  2. on:
  3. push:
  4. pull_request:
  5. types: [opened, reopened, synchronize]
  6. jobs:
  7. php-file-changed:
  8. runs-on: ubuntu-latest
  9. outputs:
  10. php: ${{ steps.filter.outputs.php }}
  11. steps:
  12. - uses: actions/checkout@v4
  13. with:
  14. fetch-depth: 0
  15. - uses: dorny/paths-filter@v3
  16. id: filter
  17. with:
  18. filters: |
  19. php:
  20. - '**/*.php'
  21. lint:
  22. needs: php-file-changed
  23. if: ${{ needs.php-file-changed.outputs.php == 'true' }}
  24. runs-on: ubuntu-latest
  25. steps:
  26. - uses: actions/checkout@v4
  27. with:
  28. fetch-depth: 0
  29. - uses: shivammathur/setup-php@v2
  30. with:
  31. php-version: 8.3
  32. - run: |
  33. composer install --no-interaction --no-progress --no-suggest --quiet
  34. php vendor/bin/phpinsights analyse --no-interaction --format=github-action \
  35. --min-style=100 --min-architecture=100 --min-quality=100