Skip to content

Commit

Permalink
Merge pull request #2101 from phalcon/development
Browse files Browse the repository at this point in the history
0.12.19
  • Loading branch information
sergeyklay authored May 13, 2020
2 parents 26d4745 + 0cfc742 commit 4345593
Show file tree
Hide file tree
Showing 1,043 changed files with 16,614 additions and 15,633 deletions.
37 changes: 12 additions & 25 deletions .ci/after-failure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,30 @@
# the LICENSE file that was distributed with this source code.

autoconf --version
echo "----------------------------------------------------------------------------"
echo "-------------------------------------------------------------------------"

cc --version
echo "----------------------------------------------------------------------------"
echo "-------------------------------------------------------------------------"

make --version
echo "----------------------------------------------------------------------------"
echo "-------------------------------------------------------------------------"

re2c --version
echo "----------------------------------------------------------------------------"
echo "-------------------------------------------------------------------------"

php -v
echo "----------------------------------------------------------------------------"
command -v php && (php -v; php -m)
echo "-------------------------------------------------------------------------"

phpize --version
echo "----------------------------------------------------------------------------"
command -v php-config && (php-config || true) # php-config returns 1
echo "-------------------------------------------------------------------------"

php -m
echo "----------------------------------------------------------------------------"

command -v php
echo "----------------------------------------------------------------------------"

command -v php-config
echo "----------------------------------------------------------------------------"

command -v phpize
echo "----------------------------------------------------------------------------"

php-config
echo "----------------------------------------------------------------------------"
command -v phpize && phpize --version
echo "-------------------------------------------------------------------------"

ls -al "$(php-config --extension-dir)"
echo "----------------------------------------------------------------------------"
echo "-------------------------------------------------------------------------"

if [ -f ./compile-errors.log ]
then
if [ -f ./compile-errors.log ]; then
log_contents=$(cat ./compile-errors.log)
[[ -z "${log_contents// }" ]] || {
(>&1 echo "Compiler log:")
Expand Down
4 changes: 2 additions & 2 deletions .ci/build-phar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ if [ "$(command -v box 2>/dev/null || true)" = "" ]; then
exit 1
fi

box validate
box compile
box validate || exit 1
box compile || exit 1

if [ ! -f "./zephir.phar" ] || [ ! -x "./zephir.phar" ]; then
(>&2 echo "Something went wrong when building zephir.phar")
Expand Down
7 changes: 4 additions & 3 deletions .ci/install-zephir-parser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
set -eu

: "${ZEPHIR_PARSER_VERSION:=development}"
PHP_VERSION=$1

echo "Install Zephir Parser using version: $ZEPHIR_PARSER_VERSION"

PHP_INI_DIR="$(dirname "$(php -i | grep /.+/conf.d/.+.ini -oE | head -n 1)")"

git clone -b "$ZEPHIR_PARSER_VERSION" \
--depth 1 \
-q https://github.com/phalcon/php-zephir-parser \
Expand All @@ -24,11 +25,11 @@ git clone -b "$ZEPHIR_PARSER_VERSION" \
cd php-zephir-parser || exit 1

phpize
./configure --with-php-config=/usr/bin/php-config --enable-zephir_parser
./configure --with-php-config="$(command -v php-config)" --enable-zephir_parser
make -j"$(getconf _NPROCESSORS_ONLN)"
sudo make install

echo 'extension="zephir_parser.so"' |\
sudo tee "/etc/php/$PHP_VERSION/cli/conf.d/zephir_parser.ini"
sudo tee "$PHP_INI_DIR/zephir_parser.ini"

php --ri "Zephir Parser"
2 changes: 1 addition & 1 deletion .ci/memcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ valgrind \
--num-callers=20 \
--run-libc-freeres=no \
php \
-d "extension=ext/modules/test.so" \
-d "extension=ext/modules/stub.so" \
"vendor/bin/simple-phpunit" \
--no-coverage \
--testsuite "$test_suite"
4 changes: 2 additions & 2 deletions .ci/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ fi
vendor/bin/simple-phpunit --version

php \
-d extension=ext/modules/test.so \
-d extension=ext/modules/stub.so \
vendor/bin/simple-phpunit \
--colors=always \
--bootstrap unit-tests/ext-bootstrap.php \
--bootstrap tests/ext-bootstrap.php \
--testsuite ${test_suite}

php \
Expand Down
4 changes: 4 additions & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ engines:
enabled: true
config:
rulesets: "phpmd.xml.dist"
phpcs:
enabled: true
config:
ruleset: "phpcs.xml.dist"

exclude_paths:
- 'ext/**'
Expand Down
1 change: 0 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ ignore:
- ".github/.*"
- ".zephir/.*"
- "ide/.*"
- "/home/travis/.phpenv/.*"
- "php-zephir-parser/.*"
- ".phpunit/.*"
- "tests/.*"
Expand Down
5 changes: 2 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

prototypes/* linguist-vendored

tests/* linguist-vendored
unit-tests/* linguist-vendored
unit-tests/fixtures/* linguist-vendored
ext/* linguist-vendored
stub/* linguist-vendored

*.xml.dist text eol=lf linguist-language=XML
*.json.dist text eol=lf linguist-language=JSON
6 changes: 4 additions & 2 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@ on:
pull_request:
branches:
- master
- develoment

jobs:
analysis:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2-beta
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
coverage: none
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linux CI
name: Unix CI

on:
push:
Expand All @@ -15,13 +15,17 @@ env:

jobs:
linux:
name: "Linux: PHP v${{ matrix.php }}"
runs-on: ubuntu-latest
name: "${{ matrix.os }}: PHP v${{ matrix.php }}"
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false

matrix:
os:
- ubuntu-18.04
# - macos-latest

php:
- '7.0'
- '7.1'
Expand Down Expand Up @@ -74,16 +78,16 @@ jobs:
date.timezone=UTC,
xdebug.max_nesting_level=256
- name: Set environment variables
- name: Set Environment Variables
run: |
echo "::set-env name=SYMFONY_PHPUNIT_VERSION::${{ matrix.symfony_phpunit }}"
echo ::set-env name=SYMFONY_PHPUNIT_VERSION::${{ matrix.symfony_phpunit }}
- name: Checkout code
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 5

- name: Common settings
- name: Common Settings
run: |
# Core dump settings
ulimit -c unlimited -S || true
Expand All @@ -94,22 +98,28 @@ jobs:
# Will be used before as a cache key
export CPUHASH="$(cat /proc/cpuinfo | grep "model name" | head -n 1 | cut -d':' -f2 | md5sum)"
- name: Setup APT repositories
- name: Setup APT Repositories
if: startsWith(runner.os, 'Linux')
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
# - name: Install System Dependencies (macOS)
# if: startsWith(runner.os, 'macOS')
# run: brew install re2c

- name: Install System Dependencies (Linux)
if: startsWith(runner.os, 'Linux')
run: |
sudo apt-get update --quiet --yes 1>/dev/null
sudo apt-get install --no-install-recommends -q -y re2c
- name: Get Zephir Parser Cache Key
id: pcache
run: echo "::set-output name=key::$(echo -n ${ZEPHIR_PARSER_VERSION}_${CPUHASH})"
run: echo ::set-output name=key::$(echo -n ${ZEPHIR_PARSER_VERSION}_${CPUHASH})

- name: Cache Zephir Parser
uses: actions/cache@v1
Expand All @@ -119,30 +129,31 @@ jobs:
restore-keys: ${{ runner.os }}-${{ matrix.php }}-zephir-parser-

- name: Install Zephir Parser
run: .ci/install-zephir-parser.sh ${{ matrix.php }}

- name: Setup GitHub Token
run: |
# To increase the GitHub rate limit we're use GitHub authentication
if [ -n "${{ secrets.GH_TOKEN }}" ]; then
composer config github-oauth.github.com "${{ secrets.GH_TOKEN }}"
fi
run: .ci/install-zephir-parser.sh

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
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-
restore-keys: |
${{ runner.os }}-composer-
- name: Install project dependencies
- name: Setup Composer Token
run: |
# To increase the GitHub rate limit we're use GitHub authentication
if [ ! -z '${{ secrets.COMPOSER_TOKEN }}' ]; then
composer config github-oauth.github.com ${{ secrets.COMPOSER_TOKEN }}
fi
- name: Install Project Dependencies
run: composer install --prefer-dist --no-interaction --no-ansi --no-progress --no-suggest

- name: Prepare Zephir executable
- name: Prepare Zephir Executable
run: sudo ln -s "$(pwd)/zephir" /usr/local/bin/zephir

- name: Fast Commands Test
Expand All @@ -154,7 +165,18 @@ jobs:
zephir stubs
zephir api
- name: Compile Test Project
# - name: Compile Test Project (macOS)
# if: startsWith(runner.os, 'macOS')
# run: |
# # These variables are needed to produce non optimized code
# CFLAGS="-O0 -g"
# CXXFLAGS="-O0 -g"

# # Export variables in the subshell to not shadow global variables
# ( export CFLAGS CXXFLAGS; zephir compile ) || false

- name: Compile Stub Project (Linux)
if: startsWith(runner.os, 'Linux')
run: |
# These variables are needed to produce non optimized code as well as for code coverage
LDFLAGS="--coverage"
Expand All @@ -165,20 +187,20 @@ jobs:
( export LDFLAGS CFLAGS CXXFLAGS; zephir compile ) || false
- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
run: echo ::add-matcher::${{ runner.tool_cache }}/phpunit.json

- name: Unit testing
- name: Unit Testing
run: .ci/run-tests.sh

- name: Black-box testing
- name: Black-box Testing
if: always()
run: cd unit-tests/sharness && PHP=$(which php) make
run: cd tests/sharness && PHP=$(which php) make

- name: After Failure
if: failure()
run: .ci/after-failure.sh

- name: Upload code coverage report
- name: Upload Code Coverage Report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -187,6 +209,6 @@ jobs:
flags: unittests
fail_ci_if_error: false

- name: Success reporting
- name: Success Reporting
if: success()
run: git log --format=fuller -5
Loading

0 comments on commit 4345593

Please sign in to comment.