From b699dcfa3be1860a1a80c6906b09c163c6d53745 Mon Sep 17 00:00:00 2001 From: HafizMMoaz Date: Mon, 2 Nov 2026 02:52:21 +0500 Subject: [PATCH] ci: prove the whole supported PHP range, 8.2 to 8.5 composer.json claims php >=8.2 with no upper bound, but CI ran 8.4 only. So three of the four versions in the supported range, including the newest, were never executed: ">=8.2" was a claim rather than a tested fact, and nothing would have caught syntax or behaviour that needs a later version. Added a compat job over 8.2, 8.3 and 8.5, which together with the 8.4 gate covers the range. The test job is left exactly as it was, name included, because the branch ruleset requires a status check named exactly "test". Turning it into a matrix would publish "test (8.2)" and the required context would never appear again, blocking every future merge. The compat job is derived from the test job rather than written fresh, so it keeps the same services, extensions, environment, coverage and steps and cannot drift from it. --- .github/workflows/ci.yml | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90b0682..a0d1477 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,6 +62,69 @@ jobs: echo "No PHPUnit config or binary found; nothing to test." fi + # The test job above is the gate and runs one version, because the + # branch ruleset requires a status check named exactly "test". This one + # covers the rest of the range composer.json claims to support, so + # ">=8.2" is a fact rather than a hope, and includes 8.5 so the newest + # release is proved too. Derived from the job above, so it keeps the same + # services, extensions, coverage and steps. + compat: + name: compat (PHP ${{ matrix.php }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ['8.2', '8.3', '8.5'] + services: + mariadb: + image: mariadb:11 + env: + MARIADB_ROOT_PASSWORD: password + MARIADB_DATABASE: framework-tests + ports: + - 3306:3306 + options: >- + --health-cmd="healthcheck.sh --connect --innodb_initialized" + --health-interval=10s --health-timeout=5s --health-retries=15 + redis: + image: redis:7 + ports: + - 6379:6379 + options: >- + --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=10 + memcached: + image: memcached:1.6 + ports: + - 11211:11211 + env: + DB_HOST: 127.0.0.1 + DB_PORT: 3306 + DB_USERNAME: root + DB_PASSWORD: password + DB_SCHEMA: framework-tests + REDIS_HOST: 127.0.0.1 + MEMCACHED_HOST: 127.0.0.1 + steps: + - uses: actions/checkout@v4 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: intl, sodium, gd, mysqli, curl, fileinfo, json, dom, simplexml, mbstring, zip, redis, memcached, apcu + coverage: xdebug + ini-values: apc.enable_cli=1, mysqli.allow_local_infile=1, xdebug.mode="develop,coverage" + - name: Validate composer.json + run: composer validate --no-check-publish + - name: Install dependencies + run: composer install --no-interaction --prefer-dist --no-progress + - name: Run tests + run: | + if [ -f vendor/bin/phpunit ] && { [ -f phpunit.xml.dist ] || [ -f phpunit.xml ]; }; then + vendor/bin/phpunit + else + echo "No PHPUnit config or binary found; nothing to test." + fi + lint: name: lint runs-on: ubuntu-latest