Skip to content

Update file

Update file #118

Workflow file for this run

on:
- pull_request
- push
name: build
jobs:
tests:
name: PHP ${{ matrix.php }}-redis-${{ matrix.redis }}
env:
key: cache-v1
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
php:
- "8.0"
redis:
- "4"
- "5"
- "6"
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
- name: Start Redis v${{ matrix.redis }}
uses: superchargejs/redis-github-action@1.4.0
with:
redis-version: ${{ matrix.redis }}
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: date.timezone='UTC'
coverage: pcov
tools: composer:v2
- name: Determine composer cache directory on Linux
if: matrix.os == 'ubuntu-latest'
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
- name: Determine composer cache directory on Windows
if: matrix.os == 'windows-latest'
run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update
- name: Install dependencies with composer php 8.0
if: matrix.php == '8.0'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Run tests with phpunit without coverage
run: vendor/bin/phpunit --colors=always
- name: Code coverage
if: matrix.php == '8.0'
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover