Run tests on PHP 8.4 and update test environment #16
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: | |
| PHPUnit: | |
| name: PHPUnit (PHP ${{ matrix.php }}) | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| php: | |
| - 8.4 | |
| - 8.3 | |
| - 8.2 | |
| - 8.1 | |
| - 8.0 | |
| - 7.4 | |
| - 7.3 | |
| - 7.2 | |
| - 7.1 | |
| - 7.0 | |
| - 5.6 | |
| - 5.5 | |
| - 5.4 | |
| - 5.3 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: ${{ matrix.php < 8.0 && 'xdebug' || 'pcov' }} | |
| ini-file: development | |
| ini-values: memory_limit=512M | |
| - run: composer install | |
| - name: Setup and debug Docker environment | |
| run: | | |
| docker pull busybox:latest | |
| docker info | |
| docker network prune -f | |
| echo "--- Docker networks before initialization ---" | |
| docker network ls | |
| # Create and test networks with verbose output | |
| for i in {1..5}; do | |
| echo "Creating network $i..." | |
| docker network create test_network_$i | |
| echo "Testing connectivity on network $i..." | |
| docker run --rm --network test_network_$i busybox echo "Network $i working" | |
| done | |
| echo "--- Docker networks after initialization ---" | |
| docker network ls | |
| # Clean up | |
| for i in {1..5}; do | |
| echo "Removing network $i..." | |
| docker network rm test_network_$i | |
| done | |
| # Additional debug info | |
| echo "--- Docker network driver info ---" | |
| docker system info | grep -A 10 "Network:" | |
| # Pre-create network for test | |
| docker network create reactphp_test_network | |
| docker network ls | |
| - name: Run tests with verbose debug output (PHP >= 7.3) | |
| if: ${{ matrix.php >= 7.3 }} | |
| run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml --debug | |
| - name: Run tests with verbose debug output (PHP < 7.3) | |
| if: ${{ matrix.php < 7.3 }} | |
| run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml -c phpunit.xml.legacy --debug | |
| - name: Check 100% code coverage | |
| shell: php {0} | |
| run: | | |
| <?php | |
| $metrics = simplexml_load_file('clover.xml')->project->metrics; | |
| exit((int) $metrics['statements'] === (int) $metrics['coveredstatements'] ? 0 : 1); |