From 3820958cb9510a9b660ab524f59460f1e6bfdb70 Mon Sep 17 00:00:00 2001 From: Nicolas Ruflin Date: Thu, 30 Apr 2026 22:42:46 +0200 Subject: [PATCH] chore(ci): add lowest-deps PHPUnit job to lock minimum constraints Without a `--prefer-lowest` job the minimum versions declared in `composer.json` are never tested. Add a unit-only PHPUnit job on PHP 8.1 that installs dependencies with `--prefer-lowest --prefer-stable` so any accidental tightening of a `composer.json` constraint is caught early. Functional tests intentionally stay out of this job to avoid doubling the cost of the ES-backed steps. --- .github/workflows/continuous-integration.yaml | 31 +++++++++++++++++++ CHANGELOG.md | 1 + 2 files changed, 32 insertions(+) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 5746081c0..e3cc21b4c 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -113,6 +113,37 @@ jobs: run: | docker compose --file=docker/compose.proxy.yaml --file=docker/compose.es.yaml logs es01 es02 + phpunit-lowest: + runs-on: 'ubuntu-24.04' + name: 'PHPUnit (lowest deps, PHP ${{ matrix.php }})' + timeout-minutes: 10 + strategy: + matrix: + php: + - '8.1' + fail-fast: false + steps: + - name: 'Checkout' + uses: 'actions/checkout@v4' + + - name: 'Setup PHP' + uses: 'shivammathur/setup-php@v2' + with: + php-version: '${{ matrix.php }}' + coverage: 'none' + tools: 'composer:v2' + extensions: 'curl, json, mbstring, openssl' + + - name: 'Install dependencies with Composer (lowest)' + uses: 'ramsey/composer-install@v3' + with: + dependency-versions: 'lowest' + composer-options: '--prefer-dist --prefer-stable' + + - name: 'Run unit tests' + run: | + vendor/bin/phpunit --group unit + phpstan: runs-on: 'ubuntu-24.04' name: 'PHPStan' diff --git a/CHANGELOG.md b/CHANGELOG.md index b4e7e1579..6c7c7161a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Added support for "search after" based pagination [#1645](https://github.com/ruflin/Elastica/issues/1645) * Added support for the `seq_no_primary_term` search option and the `if_seq_no` / `if_primary_term` index options to enable optimistic concurrency control [#2284](https://github.com/ruflin/Elastica/pull/2284) ### Changed +* Added a `phpunit-lowest` CI job that installs dependencies with `--prefer-lowest --prefer-stable` and runs the unit tests on PHP 8.1, ensuring that the minimum constraints declared in `composer.json` keep working. ### Deprecated ### Removed ### Fixed