lint.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. name: Lint
  2. on: pull_request
  3. jobs:
  4. php-linters:
  5. runs-on: ubuntu-latest
  6. strategy:
  7. matrix:
  8. php-versions: ['7.4', '8.0', '8.1', '8.2']
  9. name: php${{ matrix.php-versions }} lint
  10. steps:
  11. - name: Checkout
  12. uses: actions/checkout@master
  13. - name: Set up php${{ matrix.php-versions }}
  14. uses: shivammathur/setup-php@master
  15. with:
  16. php-version: ${{ matrix.php-versions }}
  17. extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
  18. coverage: none
  19. env:
  20. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  21. - name: Lint
  22. run: composer run lint
  23. php-cs-fixer:
  24. name: php-cs check
  25. runs-on: ubuntu-latest
  26. steps:
  27. - name: Checkout
  28. uses: actions/checkout@master
  29. - name: Set up php
  30. uses: shivammathur/setup-php@master
  31. with:
  32. php-version: 7.4
  33. extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
  34. coverage: none
  35. tools: cs2pr
  36. env:
  37. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  38. - name: Install dependencies
  39. run: composer i
  40. - name: Run coding standards check
  41. run: |
  42. composer run cs:check -- --format=checkstyle | cs2pr
  43. composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
  44. shell: bash