phpstan.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. - name: "Determine composer cache directory"
  31. id: "determine-composer-cache-directory"
  32. run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
  33. - name: "Cache dependencies installed with composer"
  34. uses: "actions/cache@v1"
  35. with:
  36. path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
  37. key: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}-${{ hashFiles('**/composer.lock') }}"
  38. restore-keys: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}"
  39. - name: "Install highest dependencies from composer.json using composer binary provided by system"
  40. run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}"
  41. - name: Run PHPStan
  42. run: |
  43. bin/composer require --dev phpstan/phpstan:^0.12 phpunit/phpunit:^7.5 --with-all-dependencies
  44. vendor/bin/phpstan analyse --configuration=phpstan/config.neon