name: PHP Composer

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Setup PHP with pecl extension
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.0'
          extensions: json, redis

      - uses: actions/checkout@v2
        with:
          fetch-depth: 1

      - name: Validate composer.json and composer.lock
        run: composer validate --strict

      - name: Get composer cache directory
        id: composer-cache
        run: echo "::set-output name=dir::$(composer config cache-files-dir)"

      - name: Cache dependencies
        uses: actions/cache@v2
        with:
          path: ${{ steps.composer-cache.outputs.dir }}
          key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
          restore-keys: ${{ runner.os }}-composer-

      - name: Install dependencies
        run: composer install --prefer-dist --no-progress

      - name: Run test suite
        run: vendor/bin/phpunit
name: PHP Composer

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  test:
    runs-on: ubuntu-latest
    services:
      redis:
        image: 'redis:6.2'
        ports:
          - 6379/tcp
        options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
    steps:
      - name: Setup PHP with pecl extension
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.0'
          extensions: json, redis

      - uses: actions/checkout@v2
        with:
          fetch-depth: 1

      - name: Validate composer.json and composer.lock
        run: composer validate --strict

      - name: Get composer cache directory
        id: composer-cache
        run: echo "::set-output name=dir::$(composer config cache-files-dir)"

      - name: Cache dependencies
        uses: actions/cache@v2
        with:
          path: ${{ steps.composer-cache.outputs.dir }}
          key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
          restore-keys: ${{ runner.os }}-composer-

      - name: Install dependencies
        run: composer install --prefer-dist --no-progress

      - name: Run test suite
        run: vendor/bin/phpunit
Add Redis service on test env
Add Redis service on test env
