Add PHP 8.0-8.5 support #13
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: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| jobs: | |
| test: | |
| name: PHP ${{ matrix.php }}${{ matrix.prefer_lowest == '--prefer-lowest' && ' (lowest)' || '' }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] | |
| prefer_lowest: [''] | |
| # --prefer-lowest only on PHP 7.4: the floor of every dependency | |
| # lives at 7.4 (mockery 1.6, phpunit 9.6, console-diff-renderer 1.0), | |
| # so a "lowest" run on PHP 8.x would install deps that don't actually | |
| # support PHP 8 at runtime. | |
| include: | |
| - php: '7.4' | |
| prefer_lowest: '--prefer-lowest' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: none | |
| tools: composer:v2 | |
| - name: Get Composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | |
| - name: Cache Composer packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: composer-${{ matrix.php }}-${{ matrix.prefer_lowest }}-${{ hashFiles('composer.json') }} | |
| restore-keys: | | |
| composer-${{ matrix.php }}- | |
| - name: Pin Composer platform to the runtime PHP version | |
| run: composer config platform.php "$(php -r 'echo PHP_VERSION;')" | |
| - name: Install dependencies | |
| run: composer update --no-interaction --prefer-dist ${{ matrix.prefer_lowest }} | |
| - name: Lint (phpcs) | |
| if: matrix.prefer_lowest == '' | |
| run: vendor/bin/phpcs --standard=./phpcs.xml.dist -p --warning-severity=0 src/ tests/ | |
| - name: Unit tests | |
| run: vendor/bin/phpunit |