Skip to content

Run tests on PHP 8.4 and update test environment #15

Run tests on PHP 8.4 and update test environment

Run tests on PHP 8.4 and update test environment #15

Workflow file for this run

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 Docker environment
run: |
docker pull busybox:latest
docker info
docker network prune -f
docker network ls
# Make sure networks are properly initialized
for i in {1..3}; do
docker network create test_network_$i
docker run --rm --network test_network_$i busybox echo "Network $i working"
done
docker network ls
# Clean up
for i in {1..3}; do
docker network rm test_network_$i
done
- name: Run tests (PHP >= 7.3)
if: ${{ matrix.php >= 7.3 }}
run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml
- name: Run tests (PHP < 7.3)
if: ${{ matrix.php < 7.3 }}
run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml -c phpunit.xml.legacy
- 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);