static-analysis.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. name: "Static Analysis"
  2. on:
  3. pull_request:
  4. branches:
  5. - "*.x"
  6. - "master"
  7. push:
  8. branches:
  9. - "*.x"
  10. - "master"
  11. env:
  12. COMPOSER_ROOT_VERSION: "2.1"
  13. jobs:
  14. static-analysis-phpstan:
  15. name: "Static Analysis with PHPStan"
  16. runs-on: "ubuntu-20.04"
  17. strategy:
  18. matrix:
  19. php-version:
  20. - "7.4"
  21. steps:
  22. - name: "Checkout code"
  23. uses: "actions/checkout@v2"
  24. - name: "Install PHP"
  25. uses: "shivammathur/setup-php@v2"
  26. with:
  27. coverage: "none"
  28. php-version: "${{ matrix.php-version }}"
  29. tools: "cs2pr"
  30. - name: "Cache dependencies installed with composer"
  31. uses: "actions/cache@v2"
  32. with:
  33. path: "~/.composer/cache"
  34. key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
  35. restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
  36. - name: "Install dependencies with composer"
  37. run: "composer install --no-interaction --no-progress --no-suggest"
  38. - name: "Run a static analysis with phpstan/phpstan"
  39. run: "vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr"
  40. static-analysis-psalm:
  41. name: "Static Analysis with Psalm"
  42. runs-on: "ubuntu-20.04"
  43. strategy:
  44. matrix:
  45. php-version:
  46. - "7.4"
  47. steps:
  48. - name: Checkout code
  49. uses: actions/checkout@v2
  50. - name: Psalm
  51. uses: docker://vimeo/psalm-github-actions