optimize redis cluster slotmap with compact slot range object #1723
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- main | |
- v2.** | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
predis: | |
name: PHP ${{ matrix.php }} (Redis ${{ matrix.redis }}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php: | |
- '7.2' | |
- '7.3' | |
- '7.4' | |
- '8.0' | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
- '8.4' | |
redis: | |
- 3 | |
- 4 | |
- 5 | |
- 6 | |
- 7 | |
- 7.4-rc2 | |
services: | |
redis: | |
image: redis:${{ matrix.redis }} | |
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
ports: | |
- 6379:6379 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup PHP with Composer and extensions | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: relay | |
coverage: ${{ (matrix.php == '8.1' && matrix.redis == '7') && 'xdebug' || 'none' }} | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v2 | |
with: | |
dependency-versions: highest | |
composer-options: ${{ matrix.php == '8.0' && '--ignore-platform-reqs' || '' }} | |
- name: Run tests | |
if: ${{ matrix.php != '8.1' || matrix.redis != '7' }} | |
run: vendor/bin/phpunit | |
- name: Run tests with coverage | |
if: ${{ matrix.php == '8.1' && matrix.redis == '7' }} | |
run: vendor/bin/phpunit --coverage-clover build/logs/clover-default.xml --coverage-filter ./src | |
- name: Run tests using Relay | |
if: ${{ matrix.php != '8.4' && matrix.redis >= '6' }} | |
run: vendor/bin/phpunit -c phpunit.relay.xml | |
- name: Run tests using Relay with coverage | |
if: ${{ matrix.php == '8.1' && matrix.redis == '7' }} | |
run: vendor/bin/phpunit -c phpunit.relay.xml --coverage-clover build/logs/clover-relay.xml --coverage-filter ./src | |
- name: Send coverage to Coveralls | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ env.COVERALLS_REPO_TOKEN && matrix.php == '8.1' && matrix.redis == '7' }} | |
run: | | |
wget "https://github.com/php-coveralls/php-coveralls/releases/download/v2.5.3/php-coveralls.phar" | |
php ./php-coveralls.phar -v | |
predis-cluster: | |
name: PHP ${{ matrix.php }} (Redis Cluster latest) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php: | |
- '7.2' | |
- '7.3' | |
- '7.4' | |
- '8.0' | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
- '8.4' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Run Redis cluster | |
uses: hoverkraft-tech/compose-action@v2.0.1 | |
with: | |
compose-file: .github/workflows/cluster/docker-compose.yml | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: relay | |
coverage: ${{ (matrix.php == '8.1') && 'xdebug' || 'none' }} | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v2 | |
with: | |
dependency-versions: highest | |
composer-options: ${{ matrix.php == '8.0' && '--ignore-platform-reqs' || '' }} | |
- name: Run tests against cluster | |
run: | | |
sleep 5 # make sure that docker image is setup | |
vendor/bin/phpunit --group cluster | |
- name: Run tests against cluster using Relay | |
run: | | |
sleep 5 # make sure nodes are stable and fully joined | |
vendor/bin/phpunit -c phpunit.relay.xml --group cluster |