Skip to content

Commit 4fac47b

Browse files
authored
Merge pull request #2364 from zephir-lang/development
0.16.0
2 parents 5828ae2 + fd6e5f1 commit 4fac47b

File tree

190 files changed

+2961
-4070
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+2961
-4070
lines changed

Diff for: .editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# EditorConfig is awesome: http://EditorConfig.org
1+
# EditorConfig is awesome: https://EditorConfig.org
22

33
# top-most EditorConfig file
44
root = true

Diff for: .github/workflows/build-linux-ext/action.yml

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
name: 'Zephir Stub PHP Extension Build'
22
description: 'Build Stub extension for Linux according to various php versions.'
3+
34
inputs:
45
compiler:
56
description: 'compiler name'
67
required: false
78
default: 'gcc'
9+
810
cflags:
911
description: 'CFLAGS for GCC compiler'
1012
required: false
1113
default: ''
14+
1215
ldflags:
1316
description: 'LDFLAGS for Linker'
1417
required: false
@@ -35,16 +38,12 @@ runs:
3538
3639
- name: Compile Stub Extension
3740
shell: bash
41+
env:
42+
CC: ${{ inputs.compiler }}
43+
CFLAGS: ${{ inputs.cflags }}
44+
CXXFLAGS: ${{ inputs.cflags }}
45+
LDFLAGS: ${{ inputs.ldflags }}
3846
run: |
39-
echo "::group::Configure compiler"
40-
CC=${{ inputs.compiler }}
41-
CFLAGS="${{ inputs.cflags }}"
42-
CXXFLAGS="${{ inputs.cflags }}"
43-
LDFLAGS="${{ inputs.ldflags }}"
44-
45-
export CC CFLAGS CXXFLAGS LDFLAGS
46-
echo "::endgroup::"
47-
4847
echo "::group::Init stage"
4948
php zephir fullclean
5049
echo "::endgroup::"
@@ -56,6 +55,13 @@ runs:
5655
echo "::group::Compile stage"
5756
cd ./ext
5857
phpize
59-
./configure --enable-stub CFLAGS="${{ inputs.cflags }}" CXXFLAGS="${{ inputs.cflags }}" LDFLAGS="${{ inputs.ldflags }}"
60-
make
58+
./configure --enable-stub
59+
make -j$(getconf _NPROCESSORS_ONLN)
6160
echo "::endgroup::"
61+
62+
- name: Enable Stub Extension
63+
shell: bash
64+
run: |
65+
sudo cp ./ext/modules/stub.so "$(php -r 'echo ini_get("extension_dir");')/stub.so"
66+
echo "extension=stub.so" > ./ext-stub.ini
67+
sudo cp ./ext-stub.ini /etc/php/${{ matrix.php }}/cli/conf.d/99-stub.ini

Diff for: .github/workflows/build-macos-ext/action.yml

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
name: 'Zephir Stub PHP Extension Build'
22
description: 'Build Stub extension for macOS according to various php versions.'
3+
34
inputs:
45
compiler:
56
description: 'compiler name'
67
required: false
78
default: 'clang'
9+
810
cflags:
911
description: 'CFLAGS for GCC compiler'
1012
required: false
1113
default: ''
14+
1215
ldflags:
1316
description: 'LDFLAGS for Linker'
1417
required: false
@@ -28,15 +31,12 @@ runs:
2831
2932
- name: Compile Stub Extension
3033
shell: bash
34+
env:
35+
CC: ${{ inputs.compiler }}
36+
CFLAGS: ${{ inputs.cflags }}
37+
CXXFLAGS: ${{ inputs.cflags }}
38+
LDFLAGS: ${{ inputs.ldflags }}
3139
run: |
32-
echo "::group::Configure compiler"
33-
CFLAGS="${{ inputs.cflags }}"
34-
CXXFLAGS="${{ inputs.cflags }}"
35-
LDFLAGS="${{ inputs.ldflags }}"
36-
37-
export CFLAGS CXXFLAGS LDFLAGS
38-
echo "::endgroup::"
39-
4040
echo "::group::Init stage"
4141
php zephir fullclean
4242
echo "::endgroup::"
@@ -48,6 +48,12 @@ runs:
4848
echo "::group::Compile stage"
4949
cd ./ext
5050
phpize
51-
./configure --enable-stub CFLAGS="${{ inputs.cflags }}" CXXFLAGS="${{ inputs.cflags }}" LDFLAGS="${{ inputs.ldflags }}"
52-
make
51+
./configure --enable-stub
52+
make -j$(getconf _NPROCESSORS_ONLN)
5353
echo "::endgroup::"
54+
55+
- name: Enable Stub Extension
56+
shell: bash
57+
run: |
58+
cp ./ext/modules/stub.so "$(php -r 'echo ini_get("extension_dir");')/stub.so"
59+
echo "extension=stub.so" > /usr/local/etc/php/${{ matrix.php }}/conf.d/99-stub.ini

Diff for: .github/workflows/build-win-ext/action.yml

+16-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ runs:
5858
}
5959
Write-Output "::endgroup::"
6060
61-
- name: Setup PHP SDK tool kit
61+
- name: Setup PHP SDK Tool Kit
6262
uses: zephir-lang/setup-php-sdk@v1
6363
with:
6464
php_version: ${{ inputs.php_version }}
@@ -73,6 +73,16 @@ runs:
7373
with:
7474
arch: ${{ inputs.arch }}
7575

76+
# Workaround for Windows-2019 and PHP 7.4 with old msvc version
77+
# PHP Warning: PHP Startup: Can't load module 'C:\tools\php\ext\php_stub.dll'
78+
# as it's linked with 14.29, but the core is linked with 14.16 in Unknown on line 0
79+
- name: Configure Developer Command Prompt for MSVC compiler
80+
if: inputs.php_version == '7.4'
81+
uses: ilammy/[email protected]
82+
with:
83+
arch: ${{ inputs.arch }}
84+
toolset: 14.16
85+
7686
- name: Generate C code
7787
shell: powershell
7888
run: |
@@ -88,10 +98,13 @@ runs:
8898
- name: Configure
8999
shell: powershell
90100
working-directory: ext
101+
env:
102+
CFLAGS: ${{ inputs.cflags }}
103+
CXXFLAGS: ${{ inputs.cflags }}
104+
LDFLAGS: ${{ inputs.ldflags }}
91105
run: |
92106
Write-Output "::group::Configure"
93-
.\configure.bat --enable-stub --with-prefix=${{ env.PHP_ROOT }} `
94-
CFLAGS="${{ inputs.cflags }}" CXXFLAGS="${{ inputs.cflags }}" LDFLAGS="${{ inputs.ldflags }}"
107+
.\configure.bat --enable-stub --with-prefix=${{ env.PHP_ROOT }}
95108
Write-Output "::endgroup::"
96109
97110
- name: Zephir compile

Diff for: .github/workflows/main.yml

+30-52
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ on:
88
- '**.md'
99
- '**.txt'
1010
- '**/nightly.yml'
11+
- '**/release.yml'
12+
- '**/FUNDING.yml'
1113
pull_request:
1214
branches:
1315
- master
14-
- develoment
16+
- development
1517

1618
env:
1719
RE2C_VERSION: 2.2
18-
ZEPHIR_PARSER_VERSION: 1.4.1
20+
ZEPHIR_PARSER_VERSION: 1.5.0
21+
PSR_VERSION: 1.2.0
1922
CACHE_DIR: .cache
2023

2124
jobs:
@@ -52,55 +55,34 @@ jobs:
5255
run: shellcheck .ci/*.sh
5356

5457
build-and-test:
55-
# To prevent build a particular commit use
56-
# git commit -m "......... [ci skip]"
57-
if: "!contains(github.event.head_commit.message, '[ci skip]')"
58+
name: "PHP-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }}"
5859

59-
name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-${{ matrix.name }}-${{ matrix.arch }}"
6060
runs-on: ${{ matrix.os }}
61-
6261
strategy:
6362
fail-fast: false
64-
6563
matrix:
66-
php: ['7.4', '8.0']
67-
build_type: ['ts', 'nts']
68-
arch: ['x64']
64+
php: [ '7.4', '8.0' , '8.1' ]
65+
ts: [ 'ts', 'nts' ]
66+
arch: [ 'x64' ]
6967

7068
name:
7169
- ubuntu-gcc
7270
- macos-clang
73-
- win2016-vc15
74-
- win2019-vs16
7571

7672
# matrix names should be in next format:
7773
# {php}-{ts}-{os.name}-{compiler}-{arch}
7874
include:
7975
# Linux
80-
- name: ubuntu-gcc
81-
os: ubuntu-18.04
82-
compiler: gcc
83-
76+
- { name: ubuntu-gcc, os: ubuntu-18.04, compiler: gcc }
8477
# macOS
85-
- name: macos-clang
86-
os: macos-10.15
87-
compiler: clang
88-
78+
- { name: macos-clang, os: macos-10.15, compiler: clang }
8979
# Windows
90-
- name: win2016-vc15
91-
os: windows-2016
92-
compiler: vc15
93-
94-
- name: win2019-vs16
95-
os: windows-2019
96-
compiler: vs16
97-
98-
exclude:
99-
- name: win2019-vs16
100-
php: '7.4'
101-
102-
- name: win2016-vc15
103-
php: '8.0'
80+
- { php: '7.4', ts: 'ts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' }
81+
- { php: '7.4', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' }
82+
- { php: '8.0', ts: 'ts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' }
83+
- { php: '8.0', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' }
84+
- { php: '8.1', ts: 'ts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' }
85+
- { php: '8.1', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' }
10486

10587
steps:
10688
- uses: actions/checkout@v2
@@ -111,7 +93,7 @@ jobs:
11193
uses: shivammathur/setup-php@v2
11294
with:
11395
php-version: '${{ matrix.php }}'
114-
extensions: mbstring, fileinfo, gmp, sqlite, pdo_sqlite, psr, zip, mysqli, zephir_parser-${{ env.ZEPHIR_PARSER_VERSION }}
96+
extensions: mbstring, fileinfo, gmp, sqlite, pdo_sqlite, psr-${{ env.PSR_VERSION }}, zip, mysqli, zephir_parser-${{ env.ZEPHIR_PARSER_VERSION }}
11597
tools: phpize, php-config
11698
coverage: xdebug
11799
# variables_order: https://github.com/zephir-lang/zephir/pull/1537
@@ -127,7 +109,7 @@ jobs:
127109
date.timezone=UTC,
128110
xdebug.max_nesting_level=256
129111
env:
130-
PHPTS: ${{ matrix.build_type }}
112+
PHPTS: ${{ matrix.ts }}
131113
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132114

133115
- name: Get composer cache directory
@@ -170,37 +152,32 @@ jobs:
170152
uses: ./.github/workflows/build-win-ext
171153
with:
172154
php_version: ${{ matrix.php }}
173-
ts: ${{ matrix.build_type }}
155+
ts: ${{ matrix.ts }}
174156
msvc: ${{ matrix.compiler }}
175157
arch: ${{ matrix.arch }}
158+
cflags: '/D ZEPHIR_RELEASE /Oi /Ot /Oy /Ob2 /Gs /GF /Gy /GL'
159+
ldflags: '/LTCG'
176160
env:
177161
CACHE_DIR: 'C:\Downloads'
178162
PHP_ROOT: 'C:\tools\php'
179163

180164
- name: Stub Extension Info
181165
shell: pwsh
182166
run: |
183-
if ("${{ runner.os }}" -eq "Windows") {
184-
php --ri stub
185-
} else {
186-
php -d extension=./ext/modules/stub.so --ri stub
187-
}
167+
php --ini
168+
php --ri stub
188169
189170
- name: Setup problem matchers for PHPUnit
190171
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
191172

192173
- name: Unit Tests (Stub Extension)
193174
shell: pwsh
194175
run: |
195-
if ("${{ runner.os }}" -eq "Windows") {
196-
php vendor/bin/phpunit -c phpunit.ext.xml
197-
} else {
198-
php -d extension=./ext/modules/stub.so vendor/bin/phpunit -c phpunit.ext.xml
199-
}
176+
php vendor/bin/phpunit -c phpunit.ext.xml
200177
201178
- name: Unit Tests (Zephir)
202179
if: always()
203-
run: vendor/bin/phpunit --testsuite Zephir
180+
run: php vendor/bin/phpunit --testsuite Zephir
204181
env:
205182
XDEBUG_MODE: coverage
206183

@@ -216,19 +193,20 @@ jobs:
216193
with:
217194
token: ${{ secrets.CODECOV_TOKEN }}
218195
files: ./tests/output/clover.xml
219-
flags: unittests,${{ matrix.name }},php-${{ matrix.php }}
196+
flags: unittests,${{ runner.os }},php-${{ matrix.php }}
220197
name: codecov-umbrella
221198

222199
- name: Upload build artifacts after Failure
223200
if: failure()
224201
uses: actions/upload-artifact@v2
225202
with:
226-
name: debug-${{ matrix.name }}-${{ matrix.php }}-${{ matrix.build_type }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}
203+
name: debug-PHP-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }}
227204
path: |
228205
${{ github.workspace }}/*.log
229206
${{ github.workspace }}/ext/
230207
!${{ github.workspace }}/ext/kernel/
231208
!${{ github.workspace }}/ext/stub/
232209
!${{ github.workspace }}/ext/Release/
233210
!${{ github.workspace }}/ext/x64/Release/
234-
retention-days: 1
211+
${{ github.workspace }}/tests/output/
212+
retention-days: 7

0 commit comments

Comments
 (0)