Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 19 additions & 31 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,40 @@ on:

jobs:
test-all:
name: Test PHP ${{ matrix.php-version }}
name: Test PHP ${{ matrix.php-version }}, Redis ${{ matrix.redis-version }}

runs-on: ${{ matrix.operating-system }}

strategy:
matrix:
operating-system: [ubuntu-latest]
php-version: ['8.1', '8.2', '8.3', '8.4']
php-version: ['8.2', '8.3', '8.4']
redis-version: ['7.4.5', '8.0.3']
include:
- operating-system: 'ubuntu-latest'
php-version: '8.4'
redis-version: '8.0.3'
run-sonarqube-analysis: true

services:
redis:
image: bitnami/redis:7.4-debian-12
ports:
- 6379:6379
env:
ALLOW_EMPTY_PASSWORD: 'yes'
options: >-
--health-cmd "redis-cli -p 6379 ping"
--health-start-period 5s
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis-sentinel:
image: bitnami/redis-sentinel:7.4-debian-12
ports:
- 26379:26379
env:
REDIS_MASTER_HOST: redis
REDIS_MASTER_SET: mymaster
REDIS_SENTINEL_QUORUM: 1
options: >-
--health-cmd "redis-cli -p 26379 ping"
--health-start-period 5s
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Redis
run: |
wget http://download.redis.io/releases/redis-${{ matrix.redis-version }}.tar.gz
tar xzf redis-${{ matrix.redis-version }}.tar.gz
cd redis-${{ matrix.redis-version }}
make
sudo make install

- name: Make Redis cluster script executable
run: chmod +x ./start-redis-cluster.sh

- name: Start Redis cluster
run: ./start-redis-cluster.sh &

- name: Setup PHPUnit
uses: shivammathur/setup-php@v2
with:
Expand Down Expand Up @@ -87,7 +75,7 @@ jobs:
env:
REDIS_SENTINEL_HOST: 127.0.0.1
REDIS_SENTINEL_PORT: 26379
REDIS_SENTINEL_SERVICE: mymaster
REDIS_SENTINEL_SERVICE: service1

- name: Prepare paths for SonarQube analysis
if: ${{ matrix.run-sonarqube-analysis && !github.event.pull_request.head.repo.fork }}
Expand Down
177 changes: 0 additions & 177 deletions .php-cs-fixer.php

This file was deleted.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ To use the Redis Sentinel driver, the `redis` section in `config/database.php` n
'sentinel_read_timeout' => (float) env('REDIS_SENTINEL_READ_TIMEOUT', 0),
'sentinel_username' => env('REDIS_SENTINEL_USERNAME'),
'sentinel_password' => env('REDIS_SENTINEL_PASSWORD'),

'connector_retry_attempts' => env('REDIS_CONNECTOR_RETRY_ATTEMPTS'),
'connector_retry_delay' => env('REDIS_CONNECTOR_RETRY_DELAY'),

'password' => env('REDIS_PASSWORD'),
'database' => (int) env('REDIS_DB', 0),
]
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-redis": "*",
"illuminate/contracts": "^8.0|^9.0|^10.0|^11.0|^12.0",
"illuminate/redis": "^8.0|^9.0|^10.0|^11.0|^12.0",
"illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"laravel/pint": "^1.22",
"orchestra/testbench": "^6.0|^7.0|^8.0|^9.0|^10.0"
},
"scripts": {
"test": [
"@test:cs",
"@test:unit"
],
"test:cs": "PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix --dry-run --diff --ansi",
"test:cs": "vendor/bin/pint -v",
"test:unit": "vendor/bin/phpunit --testdox --log-junit=phpunit.report-junit.xml --coverage-clover=phpunit.coverage-clover.xml --coverage-text",
"fix:cs": "PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix --diff --ansi"
"fix:cs": "vendor/bin/pint -v"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 3 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"preset": "laravel"
}
Loading
Loading