Skip to content

Do not use lifetime option as Redis connection timeout #1693

Do not use lifetime option as Redis connection timeout

Do not use lifetime option as Redis connection timeout #1693

Workflow file for this run

name: Codecoverage
on:
push:
paths-ignore:
- '**.md'
- '**.txt'
pull_request:
jobs:
build-and-run:
# To prevent build a particular commit use
# git commit -m "......... [ci skip]"
if: "!contains(github.event.head_commit.message, 'ci skip')"
services:
mysql:
image: mysql:5.7
ports:
- 3306
env:
MYSQL_ROOT_PASSWORD: secret
MYSQL_USER: phalcon
MYSQL_DATABASE: phalcon
MYSQL_PASSWORD: secret
postgres:
image: postgres:12-alpine
ports:
- 5432
env:
POSTGRES_PASSWORD: secret
POSTGRES_USER: phalcon
POSTGRES_DB: phalcon
redis:
image: redis:5-alpine
ports:
- 6379
memcached:
image: memcached:1.5-alpine
ports:
- 11211
runs-on: ubuntu-latest
name: Build & Run
steps:
- name: Setup Environment Variables
run: |
echo "ZEPHIR_PARSER_VERSION=v1.3.6" >> $GITHUB_ENV
echo "ZEPHIR_VERSION=0.12.21" >> $GITHUB_ENV
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: mbstring, intl, json, psr, imagick, apcu
ini-values: apc.enable_cli=on, session.save_path=/tmp
tools: prestissimo
- name: Common Settings
run: |
# Core dump settings
ulimit -c unlimited -S || true
# Hide "You are in 'detached HEAD' state" message
git config --global advice.detachedHead false
# Enable codecoverage
export LDFLAGS="${LDFLAGS} --coverage"
export CFLAGS="${CFLAGS} -O0 -ggdb -fprofile-arcs -ftest-coverage"
export CXXFLAGS="${CXXFLAGS} -O0 -ggdb -fprofile-arcs -ftest-coverage"
#set number of cores for build
export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup APT Repositories
run: |
# We don't need this at all, and our
# builds often fails because Microsoft
# servers are unstable or even offline.
sudo rm -f /etc/apt/sources.list.d/dotnetdev.list
sudo rm -f /etc/apt/sources.list.d/azure*.list
- name: Install System Dependencies
run: |
sudo apt-get update --quiet --yes 1>/dev/null
sudo apt-get install --no-install-recommends -q -y re2c
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Setup Composer Cache
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Setup Composer Token
run: |
# To increase the Composer rate limit we're use GitHub authentication
if [ -n "${{ secrets.COMPOSER_TOKEN }}" ]; then
composer config github-oauth.github.com "${{ secrets.COMPOSER_TOKEN }}"
fi
- name: Install Zephir
run: .ci/install-zephir.sh
- name: Generate C code
run: |
$HOME/bin/zephir fullclean
$HOME/bin//zephir build
echo "extension=phalcon.so" >> /etc/php/7.4/cli/php.ini
- name: Verify Install
run: php --ri phalcon
- name: Install Packages
run: composer install --prefer-dist
- name: Setup Tests
run: |
cp tests/_ci/.env.default .env
php tests/_ci/generate-db-schemas.php
vendor/bin/codecept build
- name: Run All Tests
env:
DATA_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}
DATA_POSTGRES_PORT: ${{ job.services.postgres.ports['5432'] }}
DATA_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DATA_MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }}
DATA_MYSQL_USER: root
run: |
vendor/bin/codecept run --ext DotReporter cli
vendor/bin/codecept run --ext DotReporter unit
vendor/bin/codecept run --ext DotReporter integration
vendor/bin/codecept run --ext DotReporter database -g common
vendor/bin/codecept run --ext DotReporter database -g mysql --env mysql
vendor/bin/codecept run --ext DotReporter database -g sqlite --env sqlite
- name: Upload Code Coverage on 7.4
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}