static-analysis.yml 1.1 KB

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