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