static-analysis.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. name: Static Analysis
  2. on: [push, pull_request]
  3. jobs:
  4. paypal:
  5. name: PHP ${{ matrix.php-versions }}
  6. runs-on: ubuntu-latest
  7. strategy:
  8. fail-fast: false
  9. matrix:
  10. php-versions: ['8.0', '8.1', '8.2', '8.3']
  11. steps:
  12. - name: Checkout
  13. uses: actions/checkout@v2
  14. - name: Setup PHP with Composer and extensions
  15. with:
  16. php-version: ${{ matrix.php-versions }}
  17. uses: shivammathur/setup-php@v2
  18. - name: Get Composer cache directory
  19. id: composercache
  20. run: echo "::set-output name=dir::$(composer config cache-files-dir)"
  21. - name: Cache Composer dependencies
  22. uses: actions/cache@v2
  23. with:
  24. php-version: ${{ matrix.php-versions }}
  25. path: ${{ steps.composercache.outputs.dir }}
  26. key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
  27. restore-keys: ${{ runner.os }}-composer-
  28. - name: Install Composer dependencies
  29. env:
  30. PHP_VERSION: ${{ matrix.php-versions }}
  31. run: composer install --no-progress --prefer-dist --optimize-autoloader $(if [ "$PHP_VERSION" == "8.0" || "$PHP_VERSION" == "8.1" ]; then echo "--ignore-platform-reqs"; fi;)
  32. - name: Run type checking analysis
  33. env:
  34. PHP_VERSION: ${{ matrix.php-versions }}
  35. run: vendor/bin/phpstan