lint.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. - name: Lint
  20. run: composer run lint
  21. php-cs-fixer:
  22. name: php-cs check
  23. runs-on: ubuntu-latest
  24. steps:
  25. - name: Checkout
  26. uses: actions/checkout@master
  27. - name: Set up php
  28. uses: shivammathur/setup-php@master
  29. with:
  30. php-version: 7.4
  31. extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
  32. coverage: none
  33. tools: cs2pr
  34. - name: Install dependencies
  35. run: composer i
  36. - name: Run coding standards check
  37. run: |
  38. composer run cs:check -- --format=checkstyle | cs2pr
  39. composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
  40. shell: bash