From f6b1aa93fdc5f474a075acf4314b3f5f6cde3c29 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sat, 3 Oct 2026 14:44:00 +0000 Subject: [PATCH] Update the test workflow to match XRay's and run the integration tests Test on PHP 7.2 through 8.4, up from 8.0, and update the checkout and cache actions to v4. Key the cache on the PHP version and composer.json: there's no committed composer.lock, so every matrix job was sharing one vendor cache. Add a Redis service and run the integration suite too, which the workflow never ran. Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/php.yml | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 5059597..89602b7 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -10,11 +10,24 @@ jobs: build: strategy: matrix: - php-versions: ["7.2", "7.3", "7.4", "8.0"] + # The library supports PHP 5.5+, but PHPUnit 8.5 needs 7.2 or later + php-versions: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"] runs-on: ubuntu-latest + # The integration tests use Redis on 127.0.0.1:6379 + services: + redis: + image: redis + ports: + - 6379:6379 + options: >- + --health-cmd "redis-cli ping" + --health-interval 5s + --health-timeout 5s + --health-retries 10 + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php @@ -23,20 +36,24 @@ jobs: extensions: mbstring, simplexml, dom, curl coverage: pcov - - name: Validate composer.json and composer.lock + - name: Validate composer.json run: composer validate --strict - name: Cache Composer packages id: composer-cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('composer.json') }} restore-keys: | - ${{ runner.os }}-php- - + ${{ runner.os }}-php-${{ matrix.php-versions }}- + + # There's no committed composer.lock, so resolve for each PHP version - name: Install dependencies run: composer update --prefer-dist --no-progress - - name: Run test suite + - name: Run unit tests run: composer run-script test + + - name: Run integration tests + run: vendor/bin/phpunit --testsuite integration