lint.yml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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.2', '7.3', 7.4]
  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. coverage: none
  18. - name: Lint
  19. run: composer run lint
  20. php-cs-fixer:
  21. name: php-cs check
  22. runs-on: ubuntu-latest
  23. steps:
  24. - name: Checkout
  25. uses: actions/checkout@master
  26. - name: Set up php
  27. uses: shivammathur/setup-php@master
  28. with:
  29. php-version: 7.4
  30. coverage: none
  31. tools: cs2pr
  32. - name: Install dependencies
  33. run: composer i
  34. - name: Run coding standards check
  35. run: |
  36. composer run cs:check -- --format=checkstyle | cs2pr
  37. composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
  38. shell: bash {0}