phpstan.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: "PHPStan"
  2. on:
  3. push:
  4. paths-ignore:
  5. - 'doc/**'
  6. pull_request:
  7. paths-ignore:
  8. - 'doc/**'
  9. env:
  10. COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist"
  11. SYMFONY_PHPUNIT_VERSION: ""
  12. jobs:
  13. tests:
  14. name: "PHPStan"
  15. runs-on: ubuntu-latest
  16. strategy:
  17. matrix:
  18. php-version:
  19. - "7.4"
  20. steps:
  21. - name: "Checkout"
  22. uses: "actions/checkout@v2"
  23. - name: "Install PHP"
  24. uses: "shivammathur/setup-php@v2"
  25. with:
  26. coverage: "none"
  27. extensions: "intl"
  28. ini-values: "memory_limit=-1"
  29. php-version: "${{ matrix.php-version }}"
  30. tools: "cs2pr"
  31. - name: "Determine composer cache directory"
  32. id: "determine-composer-cache-directory"
  33. run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
  34. - name: "Cache dependencies installed with composer"
  35. uses: "actions/cache@v1"
  36. with:
  37. path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
  38. key: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}-${{ hashFiles('**/composer.lock') }}"
  39. restore-keys: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}"
  40. - name: "Install highest dependencies from composer.json using composer binary provided by system"
  41. run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}"
  42. - name: Run PHPStan
  43. run: |
  44. bin/composer require --dev phpstan/phpstan:^0.12 phpunit/phpunit:^7.5 --with-all-dependencies
  45. vendor/bin/phpstan analyse --configuration=phpstan/config.neon --error-format=checkstyle | cs2pr