Upgrade to PHPStan 2.1 #2195
This file contains 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: Tests | |
# Ensure tests pass whatever is the minor PHP version currently supported (see strategy.matrix.php) | |
# crossed with "lowest" setup (install the lowest possible dependency versions allowed by the range) | |
# and with "stable" setup (install the highest possible dependency stable versions allowed by the range) | |
on: | |
push: | |
branches: [ 'master', '2.x', '3.x' ] | |
pull_request: | |
branches: [ '*' ] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [ '8.1', '8.2', '8.3', '8.4' ] | |
setup: [ 'lowest', 'stable' ] | |
name: PHP ${{ matrix.php }} - ${{ matrix.setup }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: json, imagick | |
tools: composer:v2 | |
coverage: none | |
- name: Imagick SVG support | |
continue-on-error: true | |
run: sudo apt-get install libmagickcore-6.q16-3-extra | |
- name: Cache library packages | |
id: composer-cache | |
uses: actions/cache@v4 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.setup }}-${{ hashFiles('composer.json') }} | |
- name: Install dependencies | |
if: steps.composer-cache.outputs.cache-hit != 'true' && matrix.php != '8.4' | |
run: composer update --prefer-dist --no-progress --prefer-${{ matrix.setup }} | |
# For now we need to overwrite the PHP version check on the 8.4 beta as paratest has not been releasd for it yet | |
- name: Install dependencies (PHP 8.4 beta) | |
if: steps.composer-cache.outputs.cache-hit != 'true' && matrix.php == '8.4' | |
run: composer update --prefer-dist --no-progress --prefer-${{ matrix.setup }} --ignore-platform-req=php | |
- name: Check Symfony version | |
run: php tests/symfony-version.php | |
- name: Run test suite | |
run: composer test | |
- name: Run PHPStan | |
if: matrix.php != '8.4' | |
run: vendor/bin/phpstan |