phpstan.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: "PHPStan"
  2. on:
  3. - push
  4. - pull_request
  5. env:
  6. COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
  7. SYMFONY_PHPUNIT_VERSION: ""
  8. jobs:
  9. tests:
  10. name: "PHPStan"
  11. runs-on: ubuntu-latest
  12. strategy:
  13. matrix:
  14. php-version:
  15. # pinned to 7.4 because we need PHPUnit 7.5 which does not support PHP 8
  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. - name: Get composer cache directory
  26. id: composercache
  27. run: echo "::set-output name=dir::$(composer config cache-files-dir)"
  28. - name: Cache dependencies
  29. uses: actions/cache@v2
  30. with:
  31. path: ${{ steps.composercache.outputs.dir }}
  32. key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
  33. restore-keys: ${{ runner.os }}-composer-
  34. - name: "Install latest dependencies"
  35. run: "composer update ${{ env.COMPOSER_FLAGS }}"
  36. - name: Run PHPStan
  37. # Locked to phpunit 7.5 here as newer ones have void return types which break inheritance
  38. run: |
  39. composer require --dev phpunit/phpunit:^7.5.20 --with-all-dependencies ${{ env.COMPOSER_FLAGS }}
  40. vendor/bin/phpstan analyse