coding-standards.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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.2"
  17. steps:
  18. - name: "Checkout"
  19. uses: "actions/checkout@v2"
  20. - name: Setup cache environment
  21. id: extcache
  22. uses: shivammathur/cache-extensions@v1
  23. with:
  24. php-version: ${{ matrix.php-version }}
  25. extensions: "mongodb"
  26. key: "extcache-v1"
  27. - name: Cache extensions
  28. uses: actions/cache@v2
  29. with:
  30. path: ${{ steps.extcache.outputs.dir }}
  31. key: ${{ steps.extcache.outputs.key }}
  32. restore-keys: ${{ steps.extcache.outputs.key }}
  33. - name: "Install PHP"
  34. uses: "shivammathur/setup-php@v2"
  35. with:
  36. coverage: "none"
  37. extensions: "mongodb"
  38. php-version: "${{ matrix.php-version }}"
  39. tools: "cs2pr"
  40. - name: "Show driver information"
  41. run: "php --ri mongodb"
  42. - name: "Cache dependencies installed with Composer"
  43. uses: "actions/cache@v2"
  44. with:
  45. path: "~/.composer/cache"
  46. key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.json') }}"
  47. restore-keys: "php-${{ matrix.php-version }}-composer-normal-"
  48. - name: "Install dependencies with Composer"
  49. run: "composer install --no-interaction --no-progress --no-suggest"
  50. # The -q option is required until phpcs v4 is released
  51. - name: "Run PHP_CodeSniffer"
  52. run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"