|
| 1 | +name: CI |
| 2 | + |
| 3 | +# Controls when the action will run. |
| 4 | +on: |
| 5 | + # Triggers the workflow on push or pull request events but only for the master branch |
| 6 | + push: |
| 7 | + branches: [ master ] |
| 8 | + pull_request: |
| 9 | + branches: [ master ] |
| 10 | + |
| 11 | + # Allows you to run this workflow manually from the Actions tab |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + name: PHP ${{ matrix.php-versions }} - RedisTimeSeries ${{ matrix.rts-versions }} |
| 17 | + runs-on: ubuntu-latest |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + php-versions: ['7.2', '7.3', '7.4'] |
| 21 | + rts-versions: ['1.4.8', 'edge'] |
| 22 | + services: |
| 23 | + redis: |
| 24 | + image: redislabs/redistimeseries:${{ matrix.rts-versions }} |
| 25 | + ports: |
| 26 | + - 6379:6379 |
| 27 | + options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 28 | + steps: |
| 29 | + - name: Checkout |
| 30 | + uses: actions/checkout@v2 |
| 31 | + - name: Setup PHP |
| 32 | + uses: shivammathur/setup-php@v2 |
| 33 | + with: |
| 34 | + php-version: ${{ matrix.php-versions }} |
| 35 | + extensions: redis |
| 36 | + coverage: xdebug |
| 37 | + - name: Get composer cache directory |
| 38 | + id: composer-cache |
| 39 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 40 | + - name: Cache composer dependencies |
| 41 | + uses: actions/cache@v2 |
| 42 | + with: |
| 43 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 44 | + # Use composer.json for key, if composer.lock is not committed. |
| 45 | + # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 46 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
| 47 | + restore-keys: ${{ runner.os }}-composer- |
| 48 | + - name: Install dependencies |
| 49 | + run: | |
| 50 | + composer install --no-progress --prefer-dist --optimize-autoloader |
| 51 | + - name: Run tests |
| 52 | + run: vendor/bin/phpunit --coverage-text |
| 53 | + env: |
| 54 | + REDIS_HOST: localhost |
| 55 | + REDIS_TIMESERIES_VERSION: ${{ matrix.rts-versions }} |
| 56 | + - name: Run psalm |
| 57 | + run: vendor/bin/psalm |
0 commit comments