Skip to content

build

build #1024

Workflow file for this run

name: build
on:
push:
pull_request:
schedule:
- cron: '30 6 * * *'
jobs:
tests:
name: PHP ${{ matrix.php }} Test on ${{ matrix.os }}
env:
extensions: curl, dom, hash, iconv, json, libxml, mbstring, xml, redis
key: cache-v1
PHPUNIT_COVERAGE: 0
PHP_INI: date.timezone='UTC', memory_limit=-1, opcache.enable=1, opcache.enable_cli=1
strategy:
max-parallel: 1
matrix:
os:
- ubuntu-latest
php:
- '7.1'
# - '8.1'
runs-on: ${{ matrix.os }}
services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
ini-values: ${{ env.PHP_INI }}
tools: composer:v2
- name: Determine composer cache directory
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
- name: Cache composer dependencies
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: Check PHP Version
run: php -v
- name: Check Composer Version
run: composer -V
- name: Check PHP Extensions
run: php -m
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Run tests with phpunit
run: vendor/bin/phpunit -c phpunit.xml.dist -v