coding-standards.yml 1.1 KB

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