Skip to content

1.3.3 #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.3.2-{build}
version: 1.3.3-{build}

environment:
matrix:
Expand Down Expand Up @@ -43,6 +43,16 @@ environment:
BUILD_TYPE: nts-Win32
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015

- PHP_VERSION: 7.4
VC_VERSION: 15
BUILD_TYPE: Win32
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015

- PHP_VERSION: 7.4
VC_VERSION: 15
BUILD_TYPE: nts-Win32
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015

PHP_SDK_VERSION: 2.1.9
PHP_AVM: https://raw.githubusercontent.com/sergeyklay/php-appveyor/master/php-appveyor.psm1

Expand Down
10 changes: 0 additions & 10 deletions .ci/after-failure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,7 @@ do
(>&1 printf ">>> START (%d)\\n%s\\n<<< END (%d)\\n\\n" $count "$(cat "$file")" $count)
done < <(find ./tests -type f \( -name '*.out' -o -name '*.mem' \) -print0)

# for some reason Ubuntu 18.04 on Travis CI doesn't install gdb
function install_gdb() {
if [ "${CI}" = "true" ] && [ "$(command -v gdb 2>/dev/null)" = "" ]
then
(>&1 echo "Install gdb...")
sudo apt-get install --no-install-recommends --quiet --assume-yes gdb 1> /dev/null
fi
}

for i in /tmp/core.php.*; do
install_gdb
(>&1 printf "Found core dump file: %s\\n\\n" "$i")
gdb -q "$(phpenv which php)" "$i" <<EOF
set pagination 0
Expand Down
88 changes: 64 additions & 24 deletions .ci/install-re2c.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,55 +17,95 @@ if [ "${RE2C_VERSION}" == "system" ]; then
exit 0
fi

# From https://stackoverflow.com/a/4025065
vercomp () {
if [[ $1 == $2 ]]
then
return 0
fi
local IFS=.
local i ver1=($1) ver2=($2)
# fill empty fields in ver1 with zeros
for ((i=${#ver1[@]}; i<${#ver2[@]}; i++))
do
ver1[i]=0
done
for ((i=0; i<${#ver1[@]}; i++))
do
if [[ -z ${ver2[i]} ]]
then
# fill empty fields in ver2 with zeros
ver2[i]=0
fi
if ((10#${ver1[i]} > 10#${ver2[i]}))
then
return 1
fi
if ((10#${ver1[i]} < 10#${ver2[i]}))
then
return 2
fi
done
return 0
}

ext='tar.xz'
vercomp "$RE2C_VERSION" '1.2'

case $? in
2) ext='tar.gz';;
esac

pkgname=re2c
source="https://github.com/skvadrik/${pkgname}/releases/download/${RE2C_VERSION}/${pkgname}-${RE2C_VERSION}.tar.xz"
downloaddir="${HOME}/.cache/${pkgname}/${pkgname}-${RE2C_VERSION}"
source="https://github.com/skvadrik/${pkgname}/releases/download/${RE2C_VERSION}/${pkgname}-${RE2C_VERSION}.${ext}"
downloadfile="${pkgname}-${RE2C_VERSION}.${ext}"
prefix="${HOME}/.local/opt/${pkgname}/${pkgname}-${RE2C_VERSION}"
bindir="${prefix}/bin"

if [ ! -f "${bindir}/re2c" ]; then
if [ ! -d `dirname ${downloaddir}` ]; then
mkdir -p `dirname ${downloaddir}`
if [ ! -f "$bindir/re2c" ]; then
if [ ! -d "$(dirname "$HOME/.cache/$pkgname")" ]; then
mkdir -p "$(dirname "$HOME/.cache/$pkgname")"
fi
cd "$(dirname "$downloaddir")" || exit 1

if [ ! -f "${pkgname}-${RE2C_VERSION}.tar.xz" ]; then
curl -sSL "$source" -o "${pkgname}-${RE2C_VERSION}.tar.xz"
cd "$(dirname "$HOME/.cache/$pkgname")" || exit 1

if [ ! -f "$downloadfile" ]; then
echo "curl -sSL --fail-early '$source' -o '${pkgname}-${RE2C_VERSION}.${ext}'"
curl -sSL --fail-early "$source" -o "${pkgname}-${RE2C_VERSION}.${ext}"
fi

if [ ! -f "${pkgname}-${RE2C_VERSION}.tar.xz" ]; then
>&2 echo "Unable to locate ${pkgname}-${RE2C_VERSION}.tar.xz file. Stop."
if [ ! -f "$downloadfile" ]; then
>&2 echo "Unable to locate $downloadfile file. Abort..."
exit 1
else
file "$downloadfile"
fi

if [ ! -d "${downloaddir}" ]; then
mkdir -p "${downloaddir}"
tar -xf "${pkgname}-${RE2C_VERSION}.tar.xz" || exit 1
fi
tar -xf "$downloadfile" || exit 1

if [ ! -d "${downloaddir}" ]; then
>&2 echo "Unable to locate re2c source. Stop."
if [ ! -d "${pkgname}-${RE2C_VERSION}" ]; then
>&2 echo "Unable to locate re2c source files. Abort..."
exit 1
fi

if [ ! -d "${prefix}" ]; then
mkdir -p "${prefix}"
if [ ! -d "$prefix" ]; then
mkdir -p "$prefix"
fi

cd "${downloaddir}" || exit 1
./configure --prefix="${prefix}"
cd "${pkgname}-${RE2C_VERSION}" || exit 1
./configure --prefix="$prefix"

make -j"$(getconf _NPROCESSORS_ONLN)"
make install
fi

if [ ! -x "${bindir}/re2c" ]; then
>&2 echo "Unable to locate re2c executable. Stop."
if [ ! -x "$bindir/re2c" ]; then
>&2 echo "Unable to locate re2c executable. Abort..."
exit 1
fi

mkdir -p "${HOME}/bin"
ln -s "${bindir}/re2c" "${HOME}/bin/re2c"
mkdir -p "$HOME/bin"
ln -s "$bindir/re2c" "$HOME/bin/re2c"

re2c --version
exit 0
126 changes: 126 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: build

on:
push:
branches-ignore:
- 'wip-*'
paths-ignore:
- '*.md'
pull_request:
branches:
- 'master'
- 'development'
schedule:
- cron: '0 11 * * *'

jobs:
ci:
strategy:
fail-fast: false

matrix:
re2c:
- '0.13.6'
- '1.2.1'
php:
- '7.0'
- '7.1'
- '7.3'
- '7.4'
name:
- 'Ubuntu'
- 'macOS X'

include:
- name: 'Ubuntu'
os: ubuntu-latest
ccov: ON
- name: 'macOS X'
os: macOS-latest
ccov: ON

name: "${{ matrix.name }}: PHP ${{ matrix.php }}, re2c ${{ matrix.re2c }}"
runs-on: ${{ matrix.os }}

env:
ZEND_DONT_UNLOAD_MODULES: 1
USE_ZEND_ALLOC: 0

steps:
- uses: actions/checkout@v2-beta
with:
fetch-depth: 5

- name: Install PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v1
with:
php-version: '${{ matrix.php }}'
coverage: none

- name: Setup Prerequisites (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update --quiet --yes 1>/dev/null
sudo apt-get install --no-install-recommends --quiet --yes lcov gdb

- name: Setup Prerequisites (macOS)
if: runner.os == 'macOS'
run: |
brew install lcov
sudo xcode-select -switch /Applications/Xcode.app

- name: Setup Build System (Generic)
if: runner.os != 'Windows'
run: |
ulimit -c unlimited -S || true

mkdir -p $HOME/.cache/re2c
mkdir -p $HOME/.local/opt/re2c

echo "::set-env name=RE2C_VERSION::${{ matrix.re2c }}"
echo "::set-env name=PATH::$PATH:$HOME/bin:$(brew --prefix lcov)/bin"
echo "::set-env name=MAKEFLAGS::-j$(getconf _NPROCESSORS_ONLN)"
echo "::set-env name=CI::true"

- name: Setup Core Dump (Linux)
if: runner.os == 'Linux'
run: echo '/tmp/core.%e.%p.%t' | sudo tee /proc/sys/kernel/core_pattern

- name: Install re2c ${{ matrix.re2c }}
if: runner.os != 'Windows'
run: .ci/install-re2c.sh

- name: Build extensions (Linux)
if: runner.os != 'Windows'
run: |
phpize
./configure \
--enable-zephir-parser \
--enable-zephir-parser-debug \
--enable-coverage
make -j$(getconf _NPROCESSORS_ONLN)

- name: Preparing to collect coverage data
if: matrix.ccov == 'ON'
run: make coverage-initial

- name: Run Tests
if: runner.os != 'Windows'
run: make test NO_INTERACTION=1 REPORT_EXIT_STATUS=1

- name: Print failures
if: failure() && runner.os == 'Linux'
run: .ci/after-failure.sh

- name: Capture coverage data
if: success() && matrix.ccov == 'ON'
run: make coverage-capture

- name: Upload code coverage report
if: matrix.ccov == 'ON'
uses: codecov/codecov-action@v1
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./lcov.info
flags: unittests
fail_ci_if_error: false
90 changes: 0 additions & 90 deletions .travis.yml

This file was deleted.

7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
## [1.3.3] - 2019-12-10
### Added
- Added PHP 7.4 support

## [1.3.2] - 2019-09-30
### Changed
- Files `parser.c` and `scanner.c` no longer distributed.
Expand Down Expand Up @@ -142,7 +146,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added
- Initial stable release

[Unreleased]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.2...HEAD
[Unreleased]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.3...HEAD
[1.3.3]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.2...v1.3.3
[1.3.2]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.1...v1.3.2
[1.3.1]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.0...v1.3.1
[1.3.0]: https://github.com/phalcon/php-zephir-parser/compare/v1.2.0...v1.3.0
Expand Down
Loading