Add static analysis with phpstan #227
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| - 2.x | |
| - 3.x | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: | |
| - '8.1' | |
| - '8.2' | |
| - '8.3' | |
| symfony-versions: [false] | |
| include: | |
| - description: 'Symfony 6.*' | |
| php: '8.2' | |
| symfony-versions: '^6.4' | |
| name: PHP ${{ matrix.php }} ${{ matrix.description }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.composer/cache/files | |
| key: composer-${{ matrix.php }}-${{ matrix.symfony-versions }}-${{ hashFiles('composer.json') }} | |
| restore-keys: | | |
| composer-${{ matrix.php }}- | |
| composer- | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| - name: Install symfony/flex | |
| run: composer config --global --no-plugins allow-plugins.symfony/flex true && composer global require symfony/flex | |
| if: matrix.symfony-versions | |
| - name: Install dependencies | |
| env: | |
| SYMFONY_REQUIRE: ${{ matrix.symfony-versions }} | |
| run: composer update | |
| - name: Run PHPUnit tests | |
| run: ./vendor/bin/phpunit | |
| phpstan: | |
| runs-on: ubuntu-latest | |
| name: PHPStan | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| - name: Install dependencies | |
| run: composer update | |
| - name: Run analysis | |
| run: ./vendor/bin/phpstan |