Permalink
Browse files

Minor CI's config refactor and improvements

  • Loading branch information...
sergeyklay committed Nov 3, 2018
1 parent 345085e commit 947f85f1e62415c1ed899a2352036e99e4af09d7
@@ -4,32 +4,42 @@ dist: trusty
sudo: false

php:
- 7.0
- 7.1
- 7.2
- nightly
- 'master'
- '7.3'
- '7.2'
- '7.1'
- '7.0'

git:
depth: 1

branches:
only:
- master
- /^(4|5)\.\d+\.(\d+|x)$/

addons:
apt:
packages:
- beanstalkd
- gdb
- lcov

matrix:
fast_finish: true
allow_failures:
- php: nightly

git:
depth: 1
- php: 'master'
- php: '7.3'

cache:
apt: true
ccache: true
timeout: 604800
directories:
- .temp
- $HOME/beanstalk
- $HOME/.ccache
- $HOME/.composer/cache
- $HOME/pear
- $HOME/.local/opt/re2c
- $HOME/.cache/re2c
- $HOME/.cache/composer
- ${HOME}/beanstalk
- ${HOME}/.composer/cache
- ${HOME}/pear
- ${HOME}/.local/opt
- ${HOME}/.cache/composer

services:
- beanstalkd
@@ -39,111 +49,72 @@ services:

env:
global:
- CC="ccache gcc"
- PATH="$PATH:$HOME/bin"
- CC="gcc"
- ZEPHIR_PARSER_VERSION="v1.1.2"
- RE2C_VERSION="1.0.3"
- ZEPHIR_VERSION="0.10.12"
- RE2C_VERSION="1.1.1"
- REPORT_EXIT_STATUS=1
- NO_INTERACTION=1
- TEST_PHP_ARGS="--show-diff"
# Generating a valgrind log
# For more see: https://bugs.php.net/bugs-getting-valgrind-log.php
#
# Uncomment to correctly show the stack frames for extensions compiled as shared libraries
# - ZEND_DONT_UNLOAD_MODULES=1
# Uncomment to disable Zend memory manager before running PHP with valgrind
# - USE_ZEND_ALLOC=0
- CFLAGS="-g -O0 -Wall -std=gnu90"
- PATH="${HOME}/bin:${PATH}"
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-ansi --no-progress --no-suggest"

before_install:
- if [[ ! -z "${GH_TOKEN}" ]]; then composer config github-oauth.github.com ${GH_TOKEN}; echo "Configured Github token"; fi;
- bash tests/_ci/pear_setup.sh
- bash tests/_ci/setup_dbs.sh
# Setting up test the environment
- source $TRAVIS_BUILD_DIR/tests/_ci/environment
- export $(cut -d= -f1 $TRAVIS_BUILD_DIR/tests/_ci/environment)
# Use `-g -O0' for debug purposes
- export CFLAGS="-g3 -O1 -std=gnu90 -Wall"
- '[[ -z "${GH_TOKEN}" ]] || composer config github-oauth.github.com ${GH_TOKEN}; echo "Configured Github token"'
- export PHP_MAJOR="$(`phpenv which php` -r 'echo phpversion();' | cut -d '.' -f 1)"
- export PHP_MINOR="$(`phpenv which php` -r 'echo phpversion();' | cut -d '.' -f 2)"
- export PHP_VERNUM="$(`phpenv which php-config` --vernum)"
- ./tests/_ci/pear-setup.sh
- ./tests/_ci/setup-dbs.sh
- source "${TRAVIS_BUILD_DIR}/tests/_ci/environment"
- export $(cut -d= -f1 ${TRAVIS_BUILD_DIR}/tests/_ci/environment)

install:
- bash tests/_ci/install_prereqs.sh
- bash tests/_ci/install-re2c $RE2C_VERSION
- bash tests/_ci/install_zephir_parser.sh
# Install PHP dependencies
- if [[ -d "$HOME/.cache/composer/vendor" ]]; then cp -R $HOME/.cache/composer/vendor $TRAVIS_BUILD_DIR/vendor; fi;
- composer install --no-ansi --no-progress --no-suggest
# Improve performance
- rm -rf $HOME/.cache/composer
- mkdir -p $HOME/.cache/composer/vendor
- cp -R $TRAVIS_BUILD_DIR/vendor $HOME/.cache/composer/vendor
# Install Zephir
- bash tests/_ci/install_zephir.sh
# Generate C-code
- zephir generate --backend=ZendEngine3
# Creating precompiled headers.
# If a `*.gch' file is not found then the normal header files will be used.
# For more see: http://en.wikipedia.org/wiki/Precompiled_header
- cd ${TRAVIS_BUILD_DIR}/ext
- ./tests/_ci/install-prereqs.sh
- travis_retry composer install ${DEFAULT_COMPOSER_FLAGS}
- travis_retry composer global require "phalcon/zephir:${ZEPHIR_VERSION}"
- ( cd ${HOME}/.composer/vendor/phalcon/zephir; ./install-nosudo )
- ./tests/_ci/install-re2c.sh
- ./tests/_ci/install-zephir-parser.sh
- zephir generate
- ./tests/_ci/precompile-headers.sh
- |
for file in `find kernel -name "*.h"`; do
echo -e "Creating a precompiled header: ext/${file} => ext/${file}.ghc ...";
$CC "$file" -I. $(php-config --includes) -o "$file.ghc";
done
# You may need to remove all `&> /dev/null' and `--silent' for debug purposes
- $(phpenv which phpize) &> /dev/null
- ./configure --silent --with-php-config=$(phpenv which php-config) --enable-phalcon &> /dev/null
- make --silent -j"$(getconf _NPROCESSORS_ONLN)" &> /dev/null
- make --silent install
- phpenv config-add $TRAVIS_BUILD_DIR/tests/_ci/phalcon.ini
# We use this file as our custom PHP config
- phpenv config-add $TRAVIS_BUILD_DIR/tests/_ci/ci.ini
# Some debug info is located here
- ls -al `$(phpenv which php-config) --extension-dir`
- $(phpenv which php) -v
- $(phpenv which php) -m
- $(phpenv which php) --ri phalcon
- $(phpenv which php) --ri psr
cd "${TRAVIS_BUILD_DIR}/ext"
$(phpenv which phpize)
./configure --with-php-config=$(phpenv which php-config) --enable-phalcon
make -j"$(getconf _NPROCESSORS_ONLN)" > "${TRAVIS_BUILD_DIR}/compile.log" 2> "${TRAVIS_BUILD_DIR}/compile-errors.log"
make install
cd "${TRAVIS_BUILD_DIR}"
- phpenv config-add "${TRAVIS_BUILD_DIR}/tests/_ci/phalcon.ini"
- phpenv config-add "${TRAVIS_BUILD_DIR}/tests/_ci/ci.ini"

before_script:
- ulimit -c unlimited -S || true
# Uncomment for debug purposes
# - echo '/tmp/core_%e.%p' | sudo tee /proc/sys/kernel/core_pattern &> /dev/null
# attempt to workaroung "ptrace: Operation not permitted"
# - sudo chmod +s $(which gdb)
# see: https://github.com/sebastianbergmann/phpunit/pull/3359
- '[[ "${PHP_VERNUM}" -lt 70300 ]] || export USE_ZEND_ALLOC=1'

script:
- cd $TRAVIS_BUILD_DIR
# To avoud this:
# sh: 1: /home/travis/build/phalcon/cphalcon/libtool: not found
- ln -s $TRAVIS_BUILD_DIR/ext/libtool $TRAVIS_BUILD_DIR/libtool
- ln -s ${TRAVIS_BUILD_DIR}/ext/libtool ${TRAVIS_BUILD_DIR}/libtool
# Syntax recognize tests
- |
$(phpenv which php) $TRAVIS_BUILD_DIR/ext/run-tests.php \
$(phpenv which php) "${TRAVIS_BUILD_DIR}/ext/run-tests.php" \
-p $(phpenv which php) \
-g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" \
--offline \
--show-diff \
--set-timeout 120
# Run code style tests
- vendor/bin/phpcs
# TODO: Refacto legacy unit tests from the "unit-tests" directory
- vendor/bin/codecept build --no-ansi
- vendor/bin/codecept build
# TODO: Add `cli' suite and refactor current cli-tests
- vendor/bin/codecept run --no-ansi -v -n tests/integration/
- vendor/bin/codecept run --no-ansi -v -n tests/unit/
- vendor/bin/codecept run -v -n tests/integration/
- vendor/bin/codecept run -v -n tests/unit/
# TODO: Refactor legacy unit tests from the "unit-tests" directory

# Uncomment for debug purposes
# after_failure:
# - bash tests/_ci/after_failure.sh
after_failure:
- ./tests/_ci/after-failure.sh

notifications:
# Stop spam me. I already live on Travis CI and GitHub
email:
on_success: never
on_failure: never

addons:
apt:
packages:
- beanstalkd
# Uncomment for debug
# - gdb
email: false
@@ -19,9 +19,8 @@ A big thank you to [our Backers](https://github.com/phalcon/cphalcon/blob/master
- [Ubuntu](#ubuntu)
- [Suse](#suse)
- [CentOS/Fedora/RHEL](#centosfedorarhel)
- [macOS(Sierra / El Capitan / Yosemite)](#macossierra--el-capitan--yosemite)
- [OSX MAMP ready extensions](#osx-mamp-ready-extensions)
- [Gentoo](#gentoo)
- [macOS](#macos)
- [Gentoo](#gentoo)
- [Compilation](#compilation)
- [Contributing](#contributing)
- [External Links](#external-links)
@@ -29,6 +29,7 @@ environment:
PHP_PATH: C:\Projects\php
PHP_SDK_PATH: C:\Projects\php-sdk
PHP_DEVPACK: C:\Projects\php-devpack
ZEPHIR_PATH: C:\Projects\zephir
TEST_PHP_EXECUTABLE: C:\Projects\php\php.exe
PHP_SDK_VERSION: 2.0.7
PACKAGE_PREFIX: phalcon
@@ -40,7 +41,8 @@ environment:
PARSER_VERSION: 1.1.2
PARSER_RELEASE: 290
PHALCON_STABLE_VERSION: 3.3.2
PSR_PECL_VERSION: 0.4.0
PSR_PECL_VERSION: 0.5.1
ZEPHIR_VERSION: 0.10.12

matrix:
fast_finish: true
@@ -76,6 +78,7 @@ install:
- ps: InstallPsrExtension
- ps: InstallStablePhalcon
- ps: InstallParser
- ps: InstallZephir
- ps: TuneUpPhp

build_script:
@@ -85,7 +88,7 @@ build_script:
- '"%VSCOMNTOOLS%\VsDevCmd" %PLATFORM%'
- '"%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %ARCH%'
- '%PHP_SDK_PATH%\bin\phpsdk_setvars'
- 'vendor\bin\zephir generate --backend=ZendEngine3 -Wnonexistent-function -Wnonexistent-class -Wunused-variable'
- '%ZEPHIR_PATH%\bin\zephir.bat generate --backend=ZendEngine3 -Wnonexistent-function -Wnonexistent-class -Wunused-variable'
- 'cd %APPVEYOR_BUILD_FOLDER%\build'
- 'php gen-build.php'
- 'cd %APPVEYOR_BUILD_FOLDER%\build\php7\safe'
@@ -103,14 +106,8 @@ artifacts:
name: Phalcon

on_failure :
- ps: PrintLogs "${Env:APPVEYOR_BUILD_FOLDER}"
- ps: PrintLogs "${Env:APPVEYOR_BUILD_FOLDER}\build\php7\safe"
- ps: PrintVars
- ps: PrintDirectoriesContent
- ps: PrintPhpInfo

notifications:
- provider: Email
to:
- build@phalconphp.com
subject: "Build Phalcon [{{status}}]"
on_build_status_changed: true
@@ -44,7 +44,6 @@
"codeception/specify": "1.0.*",
"codeception/verify": "1.0.*",
"mustache/mustache": "^2.11",
"phalcon/zephir": "^0.10",
"phpunit/phpunit": "^6.4",
"predis/predis": "^1.1",
"squizlabs/php_codesniffer": "^3.2",
@@ -0,0 +1,51 @@
#!/usr/bin/env bash
#
# This file is part of the Phalcon.
#
# (c) Phalcon Team <team@phalconphp.com>
#
# For the full copyright and license information, please view the LICENSE.txt
# file that was distributed with this source code.

shopt -s nullglob

export LC_ALL=C

ls -al `$(phpenv which php-config) --extension-dir`
echo

$(phpenv which php) -v
echo

$(phpenv which php-config) --vernum
echo

$(phpenv which php) -m
echo

PROJECT_ROOT=$(readlink -enq "$(dirname $0)/../../")

for i in `find ${PROJECT_ROOT}/tests/syntax -name "*.out" 2>/dev/null`; do
echo "-- START ${i}"; cat ${i}; echo "-- END";
done

for i in `find ${PROJECT_ROOT}/tests/syntax -name "*.mem" 2>/dev/null`; do
echo "-- START ${i}"; cat ${i}; echo "-- END";
done

if [ -f "${PROJECT_ROOT}/compile-errors.log" ]; then
cat "${PROJECT_ROOT}/compile-errors.log"
fi

for i in core core*; do
if [ -f "$i" -a "$(file "$i" | grep -o 'core file')" ]; then
gdb -q $(phpenv which php) "$i" <<EOF
set pagination 0
backtrace full
info registers
x/16i \$pc
thread apply all backtrace
quit
EOF
fi
done

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 947f85f

Please sign in to comment.