@ -10,11 +10,24 @@ jobs:
build:
build:
strategy:
strategy:
matrix:
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
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:
steps:
- uses : actions/checkout@v2
- uses : actions/checkout@v4
- name : Setup PHP, with composer and extensions
- name : Setup PHP, with composer and extensions
uses : shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
uses : shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
@ -23,20 +36,24 @@ jobs:
extensions : mbstring, simplexml, dom, curl
extensions : mbstring, simplexml, dom, curl
coverage : pcov
coverage : pcov
- name : Validate composer.json and composer.lock
- name : Validate composer.json
run : composer validate --strict
run : composer validate --strict
- name : Cache Composer packages
- name : Cache Composer packages
id : composer-cache
id : composer-cache
uses : actions/cache@v2
uses : actions/cache@v4
with:
with:
path : vendor
path : vendor
key : ${{ runner.os }}-php-${{ hashFiles('**/composer.lock ') }}
key : ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('composer.json ') }}
restore-keys : |
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
- name : Install dependencies
run : composer update --prefer-dist --no-progress
run : composer update --prefer-dist --no-progress
- name : Run test suite
- name : Run unit tests
run : composer run-script test
run : composer run-script test
- name : Run integration tests
run : vendor/bin/phpunit --testsuite integration