Skip to content

Commit 244890b

Browse files
authored
Merge pull request #86 from phalcon/development
1.3.3
2 parents 8c7be2f + a265faf commit 244890b

File tree

10 files changed

+223
-139
lines changed

10 files changed

+223
-139
lines changed

.appveyor.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1.3.2-{build}
1+
version: 1.3.3-{build}
22

33
environment:
44
matrix:
@@ -43,6 +43,16 @@ environment:
4343
BUILD_TYPE: nts-Win32
4444
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
4545

46+
- PHP_VERSION: 7.4
47+
VC_VERSION: 15
48+
BUILD_TYPE: Win32
49+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
50+
51+
- PHP_VERSION: 7.4
52+
VC_VERSION: 15
53+
BUILD_TYPE: nts-Win32
54+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
55+
4656
PHP_SDK_VERSION: 2.1.9
4757
PHP_AVM: https://raw.githubusercontent.com/sergeyklay/php-appveyor/master/php-appveyor.psm1
4858

.ci/after-failure.sh

-10
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,7 @@ do
1717
(>&1 printf ">>> START (%d)\\n%s\\n<<< END (%d)\\n\\n" $count "$(cat "$file")" $count)
1818
done < <(find ./tests -type f \( -name '*.out' -o -name '*.mem' \) -print0)
1919

20-
# for some reason Ubuntu 18.04 on Travis CI doesn't install gdb
21-
function install_gdb() {
22-
if [ "${CI}" = "true" ] && [ "$(command -v gdb 2>/dev/null)" = "" ]
23-
then
24-
(>&1 echo "Install gdb...")
25-
sudo apt-get install --no-install-recommends --quiet --assume-yes gdb 1> /dev/null
26-
fi
27-
}
28-
2920
for i in /tmp/core.php.*; do
30-
install_gdb
3121
(>&1 printf "Found core dump file: %s\\n\\n" "$i")
3222
gdb -q "$(phpenv which php)" "$i" <<EOF
3323
set pagination 0

.ci/install-re2c.sh

+64-24
Original file line numberDiff line numberDiff line change
@@ -17,55 +17,95 @@ if [ "${RE2C_VERSION}" == "system" ]; then
1717
exit 0
1818
fi
1919

20+
# From https://stackoverflow.com/a/4025065
21+
vercomp () {
22+
if [[ $1 == $2 ]]
23+
then
24+
return 0
25+
fi
26+
local IFS=.
27+
local i ver1=($1) ver2=($2)
28+
# fill empty fields in ver1 with zeros
29+
for ((i=${#ver1[@]}; i<${#ver2[@]}; i++))
30+
do
31+
ver1[i]=0
32+
done
33+
for ((i=0; i<${#ver1[@]}; i++))
34+
do
35+
if [[ -z ${ver2[i]} ]]
36+
then
37+
# fill empty fields in ver2 with zeros
38+
ver2[i]=0
39+
fi
40+
if ((10#${ver1[i]} > 10#${ver2[i]}))
41+
then
42+
return 1
43+
fi
44+
if ((10#${ver1[i]} < 10#${ver2[i]}))
45+
then
46+
return 2
47+
fi
48+
done
49+
return 0
50+
}
51+
52+
ext='tar.xz'
53+
vercomp "$RE2C_VERSION" '1.2'
54+
55+
case $? in
56+
2) ext='tar.gz';;
57+
esac
58+
2059
pkgname=re2c
21-
source="https://github.com/skvadrik/${pkgname}/releases/download/${RE2C_VERSION}/${pkgname}-${RE2C_VERSION}.tar.xz"
22-
downloaddir="${HOME}/.cache/${pkgname}/${pkgname}-${RE2C_VERSION}"
60+
source="https://github.com/skvadrik/${pkgname}/releases/download/${RE2C_VERSION}/${pkgname}-${RE2C_VERSION}.${ext}"
61+
downloadfile="${pkgname}-${RE2C_VERSION}.${ext}"
2362
prefix="${HOME}/.local/opt/${pkgname}/${pkgname}-${RE2C_VERSION}"
2463
bindir="${prefix}/bin"
2564

26-
if [ ! -f "${bindir}/re2c" ]; then
27-
if [ ! -d `dirname ${downloaddir}` ]; then
28-
mkdir -p `dirname ${downloaddir}`
65+
if [ ! -f "$bindir/re2c" ]; then
66+
if [ ! -d "$(dirname "$HOME/.cache/$pkgname")" ]; then
67+
mkdir -p "$(dirname "$HOME/.cache/$pkgname")"
2968
fi
30-
cd "$(dirname "$downloaddir")" || exit 1
3169

32-
if [ ! -f "${pkgname}-${RE2C_VERSION}.tar.xz" ]; then
33-
curl -sSL "$source" -o "${pkgname}-${RE2C_VERSION}.tar.xz"
70+
cd "$(dirname "$HOME/.cache/$pkgname")" || exit 1
71+
72+
if [ ! -f "$downloadfile" ]; then
73+
echo "curl -sSL --fail-early '$source' -o '${pkgname}-${RE2C_VERSION}.${ext}'"
74+
curl -sSL --fail-early "$source" -o "${pkgname}-${RE2C_VERSION}.${ext}"
3475
fi
3576

36-
if [ ! -f "${pkgname}-${RE2C_VERSION}.tar.xz" ]; then
37-
>&2 echo "Unable to locate ${pkgname}-${RE2C_VERSION}.tar.xz file. Stop."
77+
if [ ! -f "$downloadfile" ]; then
78+
>&2 echo "Unable to locate $downloadfile file. Abort..."
3879
exit 1
80+
else
81+
file "$downloadfile"
3982
fi
4083

41-
if [ ! -d "${downloaddir}" ]; then
42-
mkdir -p "${downloaddir}"
43-
tar -xf "${pkgname}-${RE2C_VERSION}.tar.xz" || exit 1
44-
fi
84+
tar -xf "$downloadfile" || exit 1
4585

46-
if [ ! -d "${downloaddir}" ]; then
47-
>&2 echo "Unable to locate re2c source. Stop."
86+
if [ ! -d "${pkgname}-${RE2C_VERSION}" ]; then
87+
>&2 echo "Unable to locate re2c source files. Abort..."
4888
exit 1
4989
fi
5090

51-
if [ ! -d "${prefix}" ]; then
52-
mkdir -p "${prefix}"
91+
if [ ! -d "$prefix" ]; then
92+
mkdir -p "$prefix"
5393
fi
5494

55-
cd "${downloaddir}" || exit 1
56-
./configure --prefix="${prefix}"
95+
cd "${pkgname}-${RE2C_VERSION}" || exit 1
96+
./configure --prefix="$prefix"
5797

5898
make -j"$(getconf _NPROCESSORS_ONLN)"
5999
make install
60100
fi
61101

62-
if [ ! -x "${bindir}/re2c" ]; then
63-
>&2 echo "Unable to locate re2c executable. Stop."
102+
if [ ! -x "$bindir/re2c" ]; then
103+
>&2 echo "Unable to locate re2c executable. Abort..."
64104
exit 1
65105
fi
66106

67-
mkdir -p "${HOME}/bin"
68-
ln -s "${bindir}/re2c" "${HOME}/bin/re2c"
107+
mkdir -p "$HOME/bin"
108+
ln -s "$bindir/re2c" "$HOME/bin/re2c"
69109

70110
re2c --version
71111
exit 0

.github/workflows/main.yml

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'wip-*'
7+
paths-ignore:
8+
- '*.md'
9+
pull_request:
10+
branches:
11+
- 'master'
12+
- 'development'
13+
schedule:
14+
- cron: '0 11 * * *'
15+
16+
jobs:
17+
ci:
18+
strategy:
19+
fail-fast: false
20+
21+
matrix:
22+
re2c:
23+
- '0.13.6'
24+
- '1.2.1'
25+
php:
26+
- '7.0'
27+
- '7.1'
28+
- '7.3'
29+
- '7.4'
30+
name:
31+
- 'Ubuntu'
32+
- 'macOS X'
33+
34+
include:
35+
- name: 'Ubuntu'
36+
os: ubuntu-latest
37+
ccov: ON
38+
- name: 'macOS X'
39+
os: macOS-latest
40+
ccov: ON
41+
42+
name: "${{ matrix.name }}: PHP ${{ matrix.php }}, re2c ${{ matrix.re2c }}"
43+
runs-on: ${{ matrix.os }}
44+
45+
env:
46+
ZEND_DONT_UNLOAD_MODULES: 1
47+
USE_ZEND_ALLOC: 0
48+
49+
steps:
50+
- uses: actions/checkout@v2-beta
51+
with:
52+
fetch-depth: 5
53+
54+
- name: Install PHP ${{ matrix.php }}
55+
uses: shivammathur/setup-php@v1
56+
with:
57+
php-version: '${{ matrix.php }}'
58+
coverage: none
59+
60+
- name: Setup Prerequisites (Linux)
61+
if: runner.os == 'Linux'
62+
run: |
63+
sudo apt-get update --quiet --yes 1>/dev/null
64+
sudo apt-get install --no-install-recommends --quiet --yes lcov gdb
65+
66+
- name: Setup Prerequisites (macOS)
67+
if: runner.os == 'macOS'
68+
run: |
69+
brew install lcov
70+
sudo xcode-select -switch /Applications/Xcode.app
71+
72+
- name: Setup Build System (Generic)
73+
if: runner.os != 'Windows'
74+
run: |
75+
ulimit -c unlimited -S || true
76+
77+
mkdir -p $HOME/.cache/re2c
78+
mkdir -p $HOME/.local/opt/re2c
79+
80+
echo "::set-env name=RE2C_VERSION::${{ matrix.re2c }}"
81+
echo "::set-env name=PATH::$PATH:$HOME/bin:$(brew --prefix lcov)/bin"
82+
echo "::set-env name=MAKEFLAGS::-j$(getconf _NPROCESSORS_ONLN)"
83+
echo "::set-env name=CI::true"
84+
85+
- name: Setup Core Dump (Linux)
86+
if: runner.os == 'Linux'
87+
run: echo '/tmp/core.%e.%p.%t' | sudo tee /proc/sys/kernel/core_pattern
88+
89+
- name: Install re2c ${{ matrix.re2c }}
90+
if: runner.os != 'Windows'
91+
run: .ci/install-re2c.sh
92+
93+
- name: Build extensions (Linux)
94+
if: runner.os != 'Windows'
95+
run: |
96+
phpize
97+
./configure \
98+
--enable-zephir-parser \
99+
--enable-zephir-parser-debug \
100+
--enable-coverage
101+
make -j$(getconf _NPROCESSORS_ONLN)
102+
103+
- name: Preparing to collect coverage data
104+
if: matrix.ccov == 'ON'
105+
run: make coverage-initial
106+
107+
- name: Run Tests
108+
if: runner.os != 'Windows'
109+
run: make test NO_INTERACTION=1 REPORT_EXIT_STATUS=1
110+
111+
- name: Print failures
112+
if: failure() && runner.os == 'Linux'
113+
run: .ci/after-failure.sh
114+
115+
- name: Capture coverage data
116+
if: success() && matrix.ccov == 'ON'
117+
run: make coverage-capture
118+
119+
- name: Upload code coverage report
120+
if: matrix.ccov == 'ON'
121+
uses: codecov/codecov-action@v1
122+
with:
123+
token: ${{secrets.CODECOV_TOKEN}}
124+
file: ./lcov.info
125+
flags: unittests
126+
fail_ci_if_error: false

.travis.yml

-90
This file was deleted.

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
8+
## [1.3.3] - 2019-12-10
9+
### Added
10+
- Added PHP 7.4 support
11+
812
## [1.3.2] - 2019-09-30
913
### Changed
1014
- Files `parser.c` and `scanner.c` no longer distributed.
@@ -142,7 +146,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
142146
### Added
143147
- Initial stable release
144148

145-
[Unreleased]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.2...HEAD
149+
[Unreleased]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.3...HEAD
150+
[1.3.3]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.2...v1.3.3
146151
[1.3.2]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.1...v1.3.2
147152
[1.3.1]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.0...v1.3.1
148153
[1.3.0]: https://github.com/phalcon/php-zephir-parser/compare/v1.2.0...v1.3.0

0 commit comments

Comments
 (0)