coding-standards.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. name: "Coding Standards"
  2. on:
  3. pull_request:
  4. branches:
  5. - "*.x"
  6. - "master"
  7. push:
  8. branches:
  9. - "*.x"
  10. - "master"
  11. env:
  12. COMPOSER_ROOT_VERSION: "2.1"
  13. jobs:
  14. coding-standards:
  15. name: "Coding Standards"
  16. runs-on: "ubuntu-20.04"
  17. strategy:
  18. matrix:
  19. php-version:
  20. - "7.4"
  21. steps:
  22. - name: "Checkout"
  23. uses: "actions/checkout@v2"
  24. - name: "Install PHP"
  25. uses: "shivammathur/setup-php@v2"
  26. with:
  27. coverage: "none"
  28. php-version: "${{ matrix.php-version }}"
  29. tools: "cs2pr"
  30. - name: "Cache dependencies installed with Composer"
  31. uses: "actions/cache@v2"
  32. with:
  33. path: "~/.composer/cache"
  34. key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
  35. restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
  36. - name: "Install dependencies with Composer"
  37. run: "composer install --no-interaction --no-progress --no-suggest"
  38. # https://github.com/doctrine/.github/issues/3
  39. - name: "Run PHP_CodeSniffer"
  40. run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"