Improve CI pipeline and fix PHP 8.5 deprecation #37
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, pull_request] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] | |
| name: PHP ${{ matrix.php-version }} Test | |
| services: | |
| redis: | |
| image: redis | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 6379:6379 | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: pcntl, sysvshm, sysvsem, sysvmsg, redis | |
| coverage: ${{ matrix.php-version == '8.5' && 'xdebug' || 'none' }} | |
| - name: Install dependencies | |
| run: composer install --no-interaction --prefer-dist | |
| - name: Run tests (with coverage) | |
| if: matrix.php-version == '8.5' | |
| run: | | |
| XDEBUG_MODE=coverage vendor/bin/phpunit --configuration phpunit.xml --coverage-clover ./coverage.xml | |
| - name: Run tests | |
| if: matrix.php-version != '8.5' | |
| run: vendor/bin/phpunit --configuration phpunit.xml | |
| - name: Upload to Codecov | |
| if: matrix.php-version == '8.5' | |
| uses: codecov/codecov-action@v4 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| files: ./coverage.xml | |
| verbose: true |