coding-standards.yml 1.1 KB

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