From b5348de830791a9e9b3e691d7a477272d5033a35 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 11 Sep 2021 20:41:14 +0100 Subject: [PATCH 01/39] #116 - Add PHP 8.1 to unix builds matrix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8d4722e..bd167f1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -222,7 +222,7 @@ jobs: fail-fast: false matrix: - php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] + php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] arch: ['x64'] build_type: ['nts'] name: From 1cef57db0645b8f5d6cca27d8982ebbca34bab97 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Thu, 25 Nov 2021 20:03:19 +0000 Subject: [PATCH 02/39] Enable PHP 8.1 version in Win builds --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf39e7aa..26b06c08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: fail-fast: false matrix: - php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] + php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] arch: ['x86', 'x64'] build_type: ['ts', 'nts'] @@ -62,6 +62,11 @@ jobs: vc_prefix: 'vs' os: windows-2019 + - php: '8.1' + vc_num: 16 + vc_prefix: 'vs' + os: windows-2019 + name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}" runs-on: ${{ matrix.os}} From dfe2dceecc9275a5717c726adf8c11d1f44807de Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Thu, 25 Nov 2021 20:08:12 +0000 Subject: [PATCH 03/39] Fix links in README.md --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 019296c0..96ba8211 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ sudo yum install php-devel gcc make re2c autoconf automake Follow these instructions to generate a binary extension for your platform: ```bash -git clone git://github.com/phalcon/php-zephir-parser.git +git clone git://github.com/zephir-lang/php-zephir-parser.git cd php-zephir-parser phpize ./configure @@ -86,7 +86,7 @@ If you have multiple/specific PHP versions installed, you may be able to specify build by using the `--with-php-config` option during configuration. For example: ```bash -git clone git://github.com/phalcon/php-zephir-parser.git +git clone git://github.com/zephir-lang/php-zephir-parser.git cd php-zephir-parser /usr/local/bin/phpize ./configure --with-php-config=/usr/local/bin/php-config @@ -144,19 +144,19 @@ Support us with a monthly donation and help us continue our activities. Zephir Parser is open source software licensed under the MIT License (MIT). See the [LICENSE][:ext-license:] file for more information. -[actions link]: https://github.com/phalcon/php-zephir-parser/actions +[actions link]: https://github.com/zephir-lang/php-zephir-parser/actions [actions badge]: https://github.com/zephir-lang/php-zephir-parser/actions/workflows/ci.yml/badge.svg [discord link]: http://phalcon.io/discord [:badge-discord:]: https://img.shields.io/discord/310910488152375297?label=Discord&logo=discord -[:badge-codecov:]: https://codecov.io/gh/phalcon/php-zephir-parser/branch/development/graph/badge.svg +[:badge-codecov:]: https://codecov.io/gh/zephir-lang/php-zephir-parser/branch/development/graph/badge.svg [:badge-license:]: https://img.shields.io/badge/license-MIT-brightgreen.svg -[:build-codecov:]: https://codecov.io/gh/phalcon/php-zephir-parser -[:ext-license:]: https://github.com/phalcon/php-zephir-parser/blob/master/LICENSE -[:latest-release:]: https://github.com/phalcon/php-zephir-parser/releases/latest -[:dev-branch:]:https://github.com/phalcon/php-zephir-parser/tree/development -[:branches:]: https://github.com/phalcon/php-zephir-parser/branches -[:tags:]: https://github.com/phalcon/php-zephir-parser/tags +[:build-codecov:]: https://codecov.io/gh/zephir-lang/php-zephir-parser +[:ext-license:]: https://github.com/zephir-lang/php-zephir-parser/blob/master/LICENSE +[:latest-release:]: https://github.com/zephir-lang/php-zephir-parser/releases/latest +[:dev-branch:]:https://github.com/zephir-lang/php-zephir-parser/tree/development +[:branches:]: https://github.com/zephir-lang/php-zephir-parser/branches +[:tags:]: https://github.com/zephir-lang/php-zephir-parser/tags [:re2c:]: http://re2c.org [:gnu-make:]: https://www.gnu.org/software/make [:gnu-autoconf:]: https://www.gnu.org/software/autoconf/autoconf.html From 2d708f9508b79cc7f2dbd4d840be9498438b9552 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Thu, 25 Nov 2021 20:20:54 +0000 Subject: [PATCH 04/39] #116 - Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 721e6398..8622b21b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Added +- Enabled support of PHP8.1 for PECL [#116](https://github.com/phalcon/php-zephir-parser/issues/116) ## [1.4.1] - 2021-09-18 ### Changed From eee76523f3731027b7d356a34eb96ba34ba8d48a Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Thu, 25 Nov 2021 21:47:20 +0000 Subject: [PATCH 05/39] #116 - Bump max to `8.1.99` --- package.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.xml b/package.xml index 27d42ad7..2f5e33e8 100644 --- a/package.xml +++ b/package.xml @@ -212,7 +212,7 @@ 7.0.0 - 8.0.99 + 8.1.99 1.10 From f242ab915a8afdd590691bcb50a711cf365763b0 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Thu, 25 Nov 2021 23:01:37 +0000 Subject: [PATCH 06/39] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 96ba8211..3473348c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The Zephir Parser delivered as a C extension for the PHP language. -Supported PHP versions: **7.0**, **7.1**, **7.2**, **7.3**, **7.4** and **8.0** +Supported PHP versions: **7.0**, **7.1**, **7.2**, **7.3**, **7.4**, **8.0** and **8.1** **NOTE:** The [`development`][:dev-branch:] branch will always contain the latest **unstable** version. If you wish to From 02801e6dbdfbf7474794a5f2a182aada7c8f26c2 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 28 Nov 2021 18:07:18 +0200 Subject: [PATCH 07/39] Disable old workflows --- .github/workflows/ci.yml | 684 +++++++++++++++++++-------------------- 1 file changed, 342 insertions(+), 342 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26b06c08..43c6fb3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,352 +17,352 @@ env: EXTENSION_FILE: php_zephir_parser.dll jobs: - windows-builds: - # To prevent build a particular commit use - # git commit -m "......... [win skip] - skip Windows builds only" - # git commit -m "......... [ci skip] - skip all builds" - if: "!contains(github.event.head_commit.message, '[win skip]') || !contains(github.event.head_commit.message, '[ci skip]') " - - strategy: - fail-fast: false - - matrix: - php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] - arch: ['x86', 'x64'] - build_type: ['ts', 'nts'] - - include: - - php: '7.0' - vc_num: 14 - vc_prefix: 'vc' - os: windows-2016 - - - php: '7.1' - vc_num: 14 - vc_prefix: 'vc' - os: windows-2016 - - - php: '7.2' - vc_num: 15 - vc_prefix: 'vc' - os: windows-2016 - - - php: '7.3' - vc_num: 15 - vc_prefix: 'vc' - os: windows-2016 - - - php: '7.4' - vc_num: 15 - vc_prefix: 'vc' - os: windows-2016 - - - php: '8.0' - vc_num: 16 - vc_prefix: 'vs' - os: windows-2019 - - - php: '8.1' - vc_num: 16 - vc_prefix: 'vs' - os: windows-2019 - - name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}" - runs-on: ${{ matrix.os}} - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 1 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: none - env: - PHPTS: ${{ matrix.build_type }} - - - name: Set Environment Variables - run: | - Write-Output "PHP_VERSION=$(php -r 'echo phpversion();')" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - Write-Output "PHP_MINOR=${{ matrix.php }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - Write-Output "TEST_PHP_EXECUTABLE=${env:PHPROOT}\php.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - Write-Output "BUILD_TYPE=${{ matrix.build_type }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - Write-Output "VC_VERSION=${{ matrix.vc_num }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - Write-Output "PHP_ARCH=${{ matrix.arch }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - Write-Output "BUILD_VERSION=${env:GITHUB_RUN_NUMBER}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - - name: Setup Common Environmet - run: | - Import-Module .\.ci\win-ci-tools.psm1 - SetupCommonEnvironment - InitializeReleaseVars - - - name: Cache Downloads - uses: actions/cache@v2 - with: - path: C:\Downloads - key: ${{ runner.os }}-zephir_parser-php-${{ matrix.php }}-${{ matrix.build_type }}-win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }} - - - name: Install System Dependencies - run: | - choco install -y --no-progress --cache-location=C:\Downloads\Choco pandoc - - - name: Install PHP SDK Binary Tools - run: | - Import-Module .\.ci\win-ci-tools.psm1 - InstallPhpSdk - - - name: Install PHP Dev pack - run: | - Import-Module .\.ci\win-ci-tools.psm1 - InstallPhpDevPack - - - name: Install MSVC Compiler Tool - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: ${{ matrix.arch }} - - - name: Set PHP SDK Environment variables - shell: cmd - run: | - call C:\tools\php-sdk\phpsdk-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}.bat - call C:\tools\php-sdk\bin\phpsdk_setvars.bat - - - name: Parse Zephir Parser (Lemon) - shell: cmd - run: | - call C:\tools\php-sdk\bin\phpsdk_setvars.bat - powershell.exe -File .\.ci\lemon-parser.ps1 - - - name: Phpize - shell: cmd - run: | - call C:\tools\php-devpack\phpize.bat - - - name: Configure - shell: cmd - run: | - call C:\tools\php-sdk\phpsdk-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}.bat - call C:\tools\php-sdk\bin\phpsdk_setvars.bat - configure --with-codegen-arch=yes --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared - - - name: Compile - shell: cmd - run: | - call C:\tools\php-sdk\phpsdk-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}.bat - call C:\tools\php-sdk\bin\phpsdk_setvars.bat - nmake - - - name: Get Zephir Parser extension info - run: | - Get-Php "${env:PHPROOT}" - Get-PhpExtension "${env:RELEASE_DLL_PATH}" - & ${env:TEST_PHP_EXECUTABLE} --ini - - - name: Enable Zephir Parser - run: | - Add-Content -Path "${env:PHPROOT}\php.ini" -Value 'extension=php_zephir_parser.dll' - Copy-Item -Path "${env:RELEASE_DLL_PATH}" -Destination "${env:PHPROOT}\ext\" - - # Run tests only for x64 PHP builds (Windows currently not support setup php with multi arch) - - name: Run Tests - if: matrix.arch == 'x64' - run: | - & ${env:TEST_PHP_EXECUTABLE} --ri zephir_parser - & ${env:TEST_PHP_EXECUTABLE} run-tests.php - - - name: Prepare Release Package - run: | - Import-Module .\.ci\win-ci-tools.psm1 - PrepareReleasePackage ` - -PhpVersion $Env:PHP_VERSION ` - -BuildType $Env:BUILD_TYPE ` - -Platform $Env:PLATFORM ` - -ZipballName $Env:RELEASE_ZIPBALL ` - -ConvertMd2Html $true ` - -ReleaseFiles "${Env:RELEASE_DLL_PATH}",` - "${Env:GITHUB_WORKSPACE}\LICENSE",` - "${Env:GITHUB_WORKSPACE}\CREDITS",` - "${Env:GITHUB_WORKSPACE}\VERSION",` - "${Env:GITHUB_WORKSPACE}\NO_WARRANTY" - - - name: Upload Zephir Parser - uses: actions/upload-artifact@v2 - with: - name: zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}.zip - path: | - ${{ github.workspace }}\zephir-parser-*.zip - - - name: Check for Errors - if: always() - run: | - Get-ChildItem (Get-Item -Path ".\" -Verbose).FullName *.log | - ForEach-Object{ - $BaseName = $_.BaseName - Write-Output "-- Log details: ${BaseName}.log --" - Get-Content -Path "${env:GITHUB_WORKSPACE}\${BaseName}.log" - } - - - name: Upload Info for Debug on Fail - if: failure() - uses: actions/upload-artifact@v2 - with: - retention-days: 2 - name: errors-zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }} - path: | - ${{ github.workspace }}\tests - ${{ github.workspace }}\parser - ${{ github.workspace }}\Release* - ${{ github.workspace }}\**\Release* - - unix-builds: - # To prevent build a particular commit use - # git commit -m "......... [unix skip] - skip Linux & macOS builds only" - # git commit -m "......... [ci skip] - skip all builds" - if: "!contains(github.event.head_commit.message, '[unix skip]') || !contains(github.event.head_commit.message, '[ci skip]') " - - strategy: - fail-fast: false - - matrix: - php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] - arch: ['x64'] - build_type: ['nts'] - name: - - ubuntu - - macos - - include: - - name: ubuntu - os: ubuntu-18.04 - ccov: ON - compiler: gcc - - - name: macos - os: macos-latest - ccov: OFF - compiler: clang - - name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}" - runs-on: ${{ matrix.os }} - - env: - HOMEBREW_NO_INSTALL_CLEANUP: 1 - ZEND_DONT_UNLOAD_MODULES: 1 - USE_ZEND_ALLOC: 0 - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 5 - - - name: Install PHP ${{ matrix.php }} - uses: shivammathur/setup-php@v2 - with: - php-version: '${{ matrix.php }}' - coverage: none - env: - PHPTS: ${{ matrix.build_type }} - - - name: Cache RE2C Downloads - uses: actions/cache@v2 - with: - path: ~/.cache/re2c - key: ${{ runner.os }}-php-${{ matrix.php }}-re2c-${{env.RE2C_VERSION}} - - - 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' && matrix.ccov == 'ON' - run: | - brew install lcov - sudo xcode-select -switch /Applications/Xcode.app - - - name: Setup Build System (Generic) - run: | - ulimit -c unlimited -S || true - - mkdir -p $HOME/.cache/re2c - mkdir -p $HOME/.local/opt/re2c - - echo "PATH=$PATH:$HOME/bin:$(brew --prefix lcov)/bin" >> $GITHUB_ENV - echo "MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN)" >> $GITHUB_ENV - echo "CI=true" >> $GITHUB_ENV - echo "ZEPHIR_PARSER_VERSION=$(head -1 VERSION)" >> $GITHUB_ENV - - - 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 - run: .ci/install-re2c.sh - - - name: Build extensions - run: | - phpize - - if [ "${{ matrix.ccov }}" = "ON" ]; then - ./configure \ - --enable-zephir-parser \ - --enable-zephir-parser-debug \ - --enable-coverage - else - ./configure \ - --enable-zephir-parser \ - --enable-zephir-parser-debug - fi - - make -j$(getconf _NPROCESSORS_ONLN) - - - name: Preparing to collect coverage data - if: matrix.ccov == 'ON' - run: make coverage-initial - - - name: Run Tests - run: | - php -d extension=./modules/zephir_parser.so --ri zephir_parser - 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: Prepare Build Artifacts - working-directory: modules - run: | - echo "-- Creating ZIP with Zephir Parser extension" - zip -rv zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip ./*.so - - - 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 - - - name: Upload Zephir Parser - uses: actions/upload-artifact@v2 - with: - name: zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip - path: | - ${{ github.workspace }}/modules/*.zip + # windows-builds: + # # To prevent build a particular commit use + # # git commit -m "......... [win skip] - skip Windows builds only" + # # git commit -m "......... [ci skip] - skip all builds" + # if: "!contains(github.event.head_commit.message, '[win skip]') || !contains(github.event.head_commit.message, '[ci skip]') " + + # strategy: + # fail-fast: false + + # matrix: + # php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + # arch: ['x86', 'x64'] + # build_type: ['ts', 'nts'] + + # include: + # - php: '7.0' + # vc_num: 14 + # vc_prefix: 'vc' + # os: windows-2016 + + # - php: '7.1' + # vc_num: 14 + # vc_prefix: 'vc' + # os: windows-2016 + + # - php: '7.2' + # vc_num: 15 + # vc_prefix: 'vc' + # os: windows-2016 + + # - php: '7.3' + # vc_num: 15 + # vc_prefix: 'vc' + # os: windows-2016 + + # - php: '7.4' + # vc_num: 15 + # vc_prefix: 'vc' + # os: windows-2016 + + # - php: '8.0' + # vc_num: 16 + # vc_prefix: 'vs' + # os: windows-2019 + + # - php: '8.1' + # vc_num: 16 + # vc_prefix: 'vs' + # os: windows-2019 + + # name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}" + # runs-on: ${{ matrix.os}} + + # steps: + # - uses: actions/checkout@v2 + # with: + # fetch-depth: 1 + + # - name: Setup PHP + # uses: shivammathur/setup-php@v2 + # with: + # php-version: ${{ matrix.php }} + # coverage: none + # env: + # PHPTS: ${{ matrix.build_type }} + + # - name: Set Environment Variables + # run: | + # Write-Output "PHP_VERSION=$(php -r 'echo phpversion();')" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + # Write-Output "PHP_MINOR=${{ matrix.php }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + # Write-Output "TEST_PHP_EXECUTABLE=${env:PHPROOT}\php.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + # Write-Output "BUILD_TYPE=${{ matrix.build_type }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + # Write-Output "VC_VERSION=${{ matrix.vc_num }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + # Write-Output "PHP_ARCH=${{ matrix.arch }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + # Write-Output "BUILD_VERSION=${env:GITHUB_RUN_NUMBER}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + # - name: Setup Common Environmet + # run: | + # Import-Module .\.ci\win-ci-tools.psm1 + # SetupCommonEnvironment + # InitializeReleaseVars + + # - name: Cache Downloads + # uses: actions/cache@v2 + # with: + # path: C:\Downloads + # key: ${{ runner.os }}-zephir_parser-php-${{ matrix.php }}-${{ matrix.build_type }}-win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }} + + # - name: Install System Dependencies + # run: | + # choco install -y --no-progress --cache-location=C:\Downloads\Choco pandoc + + # - name: Install PHP SDK Binary Tools + # run: | + # Import-Module .\.ci\win-ci-tools.psm1 + # InstallPhpSdk + + # - name: Install PHP Dev pack + # run: | + # Import-Module .\.ci\win-ci-tools.psm1 + # InstallPhpDevPack + + # - name: Install MSVC Compiler Tool + # uses: ilammy/msvc-dev-cmd@v1 + # with: + # arch: ${{ matrix.arch }} + + # - name: Set PHP SDK Environment variables + # shell: cmd + # run: | + # call C:\tools\php-sdk\phpsdk-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}.bat + # call C:\tools\php-sdk\bin\phpsdk_setvars.bat + + # - name: Parse Zephir Parser (Lemon) + # shell: cmd + # run: | + # call C:\tools\php-sdk\bin\phpsdk_setvars.bat + # powershell.exe -File .\.ci\lemon-parser.ps1 + + # - name: Phpize + # shell: cmd + # run: | + # call C:\tools\php-devpack\phpize.bat + + # - name: Configure + # shell: cmd + # run: | + # call C:\tools\php-sdk\phpsdk-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}.bat + # call C:\tools\php-sdk\bin\phpsdk_setvars.bat + # configure --with-codegen-arch=yes --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared + + # - name: Compile + # shell: cmd + # run: | + # call C:\tools\php-sdk\phpsdk-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}.bat + # call C:\tools\php-sdk\bin\phpsdk_setvars.bat + # nmake + + # - name: Get Zephir Parser extension info + # run: | + # Get-Php "${env:PHPROOT}" + # Get-PhpExtension "${env:RELEASE_DLL_PATH}" + # & ${env:TEST_PHP_EXECUTABLE} --ini + + # - name: Enable Zephir Parser + # run: | + # Add-Content -Path "${env:PHPROOT}\php.ini" -Value 'extension=php_zephir_parser.dll' + # Copy-Item -Path "${env:RELEASE_DLL_PATH}" -Destination "${env:PHPROOT}\ext\" + + # # Run tests only for x64 PHP builds (Windows currently not support setup php with multi arch) + # - name: Run Tests + # if: matrix.arch == 'x64' + # run: | + # & ${env:TEST_PHP_EXECUTABLE} --ri zephir_parser + # & ${env:TEST_PHP_EXECUTABLE} run-tests.php + + # - name: Prepare Release Package + # run: | + # Import-Module .\.ci\win-ci-tools.psm1 + # PrepareReleasePackage ` + # -PhpVersion $Env:PHP_VERSION ` + # -BuildType $Env:BUILD_TYPE ` + # -Platform $Env:PLATFORM ` + # -ZipballName $Env:RELEASE_ZIPBALL ` + # -ConvertMd2Html $true ` + # -ReleaseFiles "${Env:RELEASE_DLL_PATH}",` + # "${Env:GITHUB_WORKSPACE}\LICENSE",` + # "${Env:GITHUB_WORKSPACE}\CREDITS",` + # "${Env:GITHUB_WORKSPACE}\VERSION",` + # "${Env:GITHUB_WORKSPACE}\NO_WARRANTY" + + # - name: Upload Zephir Parser + # uses: actions/upload-artifact@v2 + # with: + # name: zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}.zip + # path: | + # ${{ github.workspace }}\zephir-parser-*.zip + + # - name: Check for Errors + # if: always() + # run: | + # Get-ChildItem (Get-Item -Path ".\" -Verbose).FullName *.log | + # ForEach-Object{ + # $BaseName = $_.BaseName + # Write-Output "-- Log details: ${BaseName}.log --" + # Get-Content -Path "${env:GITHUB_WORKSPACE}\${BaseName}.log" + # } + + # - name: Upload Info for Debug on Fail + # if: failure() + # uses: actions/upload-artifact@v2 + # with: + # retention-days: 2 + # name: errors-zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }} + # path: | + # ${{ github.workspace }}\tests + # ${{ github.workspace }}\parser + # ${{ github.workspace }}\Release* + # ${{ github.workspace }}\**\Release* + + # unix-builds: + # # To prevent build a particular commit use + # # git commit -m "......... [unix skip] - skip Linux & macOS builds only" + # # git commit -m "......... [ci skip] - skip all builds" + # if: "!contains(github.event.head_commit.message, '[unix skip]') || !contains(github.event.head_commit.message, '[ci skip]') " + + # strategy: + # fail-fast: false + + # matrix: + # php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + # arch: ['x64'] + # build_type: ['nts'] + # name: + # - ubuntu + # - macos + + # include: + # - name: ubuntu + # os: ubuntu-18.04 + # ccov: ON + # compiler: gcc + + # - name: macos + # os: macos-latest + # ccov: OFF + # compiler: clang + + # name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}" + # runs-on: ${{ matrix.os }} + + # env: + # HOMEBREW_NO_INSTALL_CLEANUP: 1 + # ZEND_DONT_UNLOAD_MODULES: 1 + # USE_ZEND_ALLOC: 0 + + # steps: + # - uses: actions/checkout@v2 + # with: + # fetch-depth: 5 + + # - name: Install PHP ${{ matrix.php }} + # uses: shivammathur/setup-php@v2 + # with: + # php-version: '${{ matrix.php }}' + # coverage: none + # env: + # PHPTS: ${{ matrix.build_type }} + + # - name: Cache RE2C Downloads + # uses: actions/cache@v2 + # with: + # path: ~/.cache/re2c + # key: ${{ runner.os }}-php-${{ matrix.php }}-re2c-${{env.RE2C_VERSION}} + + # - 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' && matrix.ccov == 'ON' + # run: | + # brew install lcov + # sudo xcode-select -switch /Applications/Xcode.app + + # - name: Setup Build System (Generic) + # run: | + # ulimit -c unlimited -S || true + + # mkdir -p $HOME/.cache/re2c + # mkdir -p $HOME/.local/opt/re2c + + # echo "PATH=$PATH:$HOME/bin:$(brew --prefix lcov)/bin" >> $GITHUB_ENV + # echo "MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN)" >> $GITHUB_ENV + # echo "CI=true" >> $GITHUB_ENV + # echo "ZEPHIR_PARSER_VERSION=$(head -1 VERSION)" >> $GITHUB_ENV + + # - 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 + # run: .ci/install-re2c.sh + + # - name: Build extensions + # run: | + # phpize + + # if [ "${{ matrix.ccov }}" = "ON" ]; then + # ./configure \ + # --enable-zephir-parser \ + # --enable-zephir-parser-debug \ + # --enable-coverage + # else + # ./configure \ + # --enable-zephir-parser \ + # --enable-zephir-parser-debug + # fi + + # make -j$(getconf _NPROCESSORS_ONLN) + + # - name: Preparing to collect coverage data + # if: matrix.ccov == 'ON' + # run: make coverage-initial + + # - name: Run Tests + # run: | + # php -d extension=./modules/zephir_parser.so --ri zephir_parser + # 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: Prepare Build Artifacts + # working-directory: modules + # run: | + # echo "-- Creating ZIP with Zephir Parser extension" + # zip -rv zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip ./*.so + + # - 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 + + # - name: Upload Zephir Parser + # uses: actions/upload-artifact@v2 + # with: + # name: zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip + # path: | + # ${{ github.workspace }}/modules/*.zip release: if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - needs: [windows-builds, unix-builds] + needs: [ builds ] name: Create Release runs-on: ubuntu-20.04 From 2f8da1a0ef89e29af618ef6adab22098a98af509 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 28 Nov 2021 18:48:57 +0200 Subject: [PATCH 08/39] Add initial Linux build --- .github/actions/build-linux/action.yml | 34 +++ .github/workflows/ci.yml | 390 ++++--------------------- 2 files changed, 88 insertions(+), 336 deletions(-) create mode 100644 .github/actions/build-linux/action.yml diff --git a/.github/actions/build-linux/action.yml b/.github/actions/build-linux/action.yml new file mode 100644 index 00000000..838f4780 --- /dev/null +++ b/.github/actions/build-linux/action.yml @@ -0,0 +1,34 @@ +name: 'Zephir Parser PHP extension build action' +description: 'Build Zephir Parser for Linux according to various PHP versions.' + +runs: + using: 'composite' + steps: + - name: Install RE2C Lexer Generator + shell: bash + run: | + sudo apt-get install re2c + + - name: Build Zephir Parser for Linux + shell: bash + working-directory: ${{ github.workspace }} + run: | + echo "::group::Run phpize" + phpize + echo "::endgroup::" + + echo "::group::Run configure" + ./configure \ + --enable-zephir-parser \ + --enable-zephir-parser-debug + echo "::endgroup::" + + echo "::group::Compile" + make -j$(getconf _NPROCESSORS_ONLN) + echo "::endgroup::" + + - name: Check Extension + shell: bash + run: | + php -d extension=./modules/zephir_parser.so --ri zephir_parser + make test NO_INTERACTION=1 REPORT_EXIT_STATUS=1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43c6fb3f..ac00da61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,10 @@ +# This file is part of the Zephir Parser. +# +# (c) Zephir Team +# +# For the full copyright and license information, please view +# the LICENSE file that was distributed with this source code. + name: Zephir Parser CI on: @@ -17,347 +24,58 @@ env: EXTENSION_FILE: php_zephir_parser.dll jobs: - # windows-builds: - # # To prevent build a particular commit use - # # git commit -m "......... [win skip] - skip Windows builds only" - # # git commit -m "......... [ci skip] - skip all builds" - # if: "!contains(github.event.head_commit.message, '[win skip]') || !contains(github.event.head_commit.message, '[ci skip]') " - - # strategy: - # fail-fast: false - - # matrix: - # php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] - # arch: ['x86', 'x64'] - # build_type: ['ts', 'nts'] - - # include: - # - php: '7.0' - # vc_num: 14 - # vc_prefix: 'vc' - # os: windows-2016 - - # - php: '7.1' - # vc_num: 14 - # vc_prefix: 'vc' - # os: windows-2016 - - # - php: '7.2' - # vc_num: 15 - # vc_prefix: 'vc' - # os: windows-2016 - - # - php: '7.3' - # vc_num: 15 - # vc_prefix: 'vc' - # os: windows-2016 - - # - php: '7.4' - # vc_num: 15 - # vc_prefix: 'vc' - # os: windows-2016 - - # - php: '8.0' - # vc_num: 16 - # vc_prefix: 'vs' - # os: windows-2019 - - # - php: '8.1' - # vc_num: 16 - # vc_prefix: 'vs' - # os: windows-2019 - - # name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}" - # runs-on: ${{ matrix.os}} - - # steps: - # - uses: actions/checkout@v2 - # with: - # fetch-depth: 1 - - # - name: Setup PHP - # uses: shivammathur/setup-php@v2 - # with: - # php-version: ${{ matrix.php }} - # coverage: none - # env: - # PHPTS: ${{ matrix.build_type }} - - # - name: Set Environment Variables - # run: | - # Write-Output "PHP_VERSION=$(php -r 'echo phpversion();')" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - # Write-Output "PHP_MINOR=${{ matrix.php }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - # Write-Output "TEST_PHP_EXECUTABLE=${env:PHPROOT}\php.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - # Write-Output "BUILD_TYPE=${{ matrix.build_type }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - # Write-Output "VC_VERSION=${{ matrix.vc_num }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - # Write-Output "PHP_ARCH=${{ matrix.arch }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - # Write-Output "BUILD_VERSION=${env:GITHUB_RUN_NUMBER}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - # - name: Setup Common Environmet - # run: | - # Import-Module .\.ci\win-ci-tools.psm1 - # SetupCommonEnvironment - # InitializeReleaseVars - - # - name: Cache Downloads - # uses: actions/cache@v2 - # with: - # path: C:\Downloads - # key: ${{ runner.os }}-zephir_parser-php-${{ matrix.php }}-${{ matrix.build_type }}-win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }} - - # - name: Install System Dependencies - # run: | - # choco install -y --no-progress --cache-location=C:\Downloads\Choco pandoc - - # - name: Install PHP SDK Binary Tools - # run: | - # Import-Module .\.ci\win-ci-tools.psm1 - # InstallPhpSdk - - # - name: Install PHP Dev pack - # run: | - # Import-Module .\.ci\win-ci-tools.psm1 - # InstallPhpDevPack - - # - name: Install MSVC Compiler Tool - # uses: ilammy/msvc-dev-cmd@v1 - # with: - # arch: ${{ matrix.arch }} - - # - name: Set PHP SDK Environment variables - # shell: cmd - # run: | - # call C:\tools\php-sdk\phpsdk-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}.bat - # call C:\tools\php-sdk\bin\phpsdk_setvars.bat - - # - name: Parse Zephir Parser (Lemon) - # shell: cmd - # run: | - # call C:\tools\php-sdk\bin\phpsdk_setvars.bat - # powershell.exe -File .\.ci\lemon-parser.ps1 - - # - name: Phpize - # shell: cmd - # run: | - # call C:\tools\php-devpack\phpize.bat - - # - name: Configure - # shell: cmd - # run: | - # call C:\tools\php-sdk\phpsdk-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}.bat - # call C:\tools\php-sdk\bin\phpsdk_setvars.bat - # configure --with-codegen-arch=yes --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared - - # - name: Compile - # shell: cmd - # run: | - # call C:\tools\php-sdk\phpsdk-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}.bat - # call C:\tools\php-sdk\bin\phpsdk_setvars.bat - # nmake - - # - name: Get Zephir Parser extension info - # run: | - # Get-Php "${env:PHPROOT}" - # Get-PhpExtension "${env:RELEASE_DLL_PATH}" - # & ${env:TEST_PHP_EXECUTABLE} --ini - - # - name: Enable Zephir Parser - # run: | - # Add-Content -Path "${env:PHPROOT}\php.ini" -Value 'extension=php_zephir_parser.dll' - # Copy-Item -Path "${env:RELEASE_DLL_PATH}" -Destination "${env:PHPROOT}\ext\" - - # # Run tests only for x64 PHP builds (Windows currently not support setup php with multi arch) - # - name: Run Tests - # if: matrix.arch == 'x64' - # run: | - # & ${env:TEST_PHP_EXECUTABLE} --ri zephir_parser - # & ${env:TEST_PHP_EXECUTABLE} run-tests.php - - # - name: Prepare Release Package - # run: | - # Import-Module .\.ci\win-ci-tools.psm1 - # PrepareReleasePackage ` - # -PhpVersion $Env:PHP_VERSION ` - # -BuildType $Env:BUILD_TYPE ` - # -Platform $Env:PLATFORM ` - # -ZipballName $Env:RELEASE_ZIPBALL ` - # -ConvertMd2Html $true ` - # -ReleaseFiles "${Env:RELEASE_DLL_PATH}",` - # "${Env:GITHUB_WORKSPACE}\LICENSE",` - # "${Env:GITHUB_WORKSPACE}\CREDITS",` - # "${Env:GITHUB_WORKSPACE}\VERSION",` - # "${Env:GITHUB_WORKSPACE}\NO_WARRANTY" + builds: + name: build / PHP-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }} + + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + # php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ] + php: [ '7.0' ] + ts: [ 'nts' ] + arch: [ 'x64' ] + name: + - ubuntu-gcc + # - macos-clang + # - windows2016-vc15 + # - windows2019-vs16 + + # matrix names should be in next format: + # {php}-{ts}-{os.name}-{compiler}-{arch} + include: + # Linux + - name: ubuntu-gcc + os: ubuntu-18.04 + compiler: gcc - # - name: Upload Zephir Parser - # uses: actions/upload-artifact@v2 - # with: - # name: zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}.zip - # path: | - # ${{ github.workspace }}\zephir-parser-*.zip - - # - name: Check for Errors - # if: always() - # run: | - # Get-ChildItem (Get-Item -Path ".\" -Verbose).FullName *.log | - # ForEach-Object{ - # $BaseName = $_.BaseName - # Write-Output "-- Log details: ${BaseName}.log --" - # Get-Content -Path "${env:GITHUB_WORKSPACE}\${BaseName}.log" - # } - - # - name: Upload Info for Debug on Fail - # if: failure() - # uses: actions/upload-artifact@v2 - # with: - # retention-days: 2 - # name: errors-zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }} - # path: | - # ${{ github.workspace }}\tests - # ${{ github.workspace }}\parser - # ${{ github.workspace }}\Release* - # ${{ github.workspace }}\**\Release* - - # unix-builds: - # # To prevent build a particular commit use - # # git commit -m "......... [unix skip] - skip Linux & macOS builds only" - # # git commit -m "......... [ci skip] - skip all builds" - # if: "!contains(github.event.head_commit.message, '[unix skip]') || !contains(github.event.head_commit.message, '[ci skip]') " - - # strategy: - # fail-fast: false - - # matrix: - # php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] - # arch: ['x64'] - # build_type: ['nts'] - # name: - # - ubuntu - # - macos - - # include: - # - name: ubuntu - # os: ubuntu-18.04 - # ccov: ON - # compiler: gcc - - # - name: macos - # os: macos-latest - # ccov: OFF - # compiler: clang - - # name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}" - # runs-on: ${{ matrix.os }} - - # env: - # HOMEBREW_NO_INSTALL_CLEANUP: 1 - # ZEND_DONT_UNLOAD_MODULES: 1 - # USE_ZEND_ALLOC: 0 - - # steps: - # - uses: actions/checkout@v2 - # with: - # fetch-depth: 5 - - # - name: Install PHP ${{ matrix.php }} - # uses: shivammathur/setup-php@v2 - # with: - # php-version: '${{ matrix.php }}' - # coverage: none - # env: - # PHPTS: ${{ matrix.build_type }} - - # - name: Cache RE2C Downloads - # uses: actions/cache@v2 - # with: - # path: ~/.cache/re2c - # key: ${{ runner.os }}-php-${{ matrix.php }}-re2c-${{env.RE2C_VERSION}} - - # - 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' && matrix.ccov == 'ON' - # run: | - # brew install lcov - # sudo xcode-select -switch /Applications/Xcode.app - - # - name: Setup Build System (Generic) - # run: | - # ulimit -c unlimited -S || true - - # mkdir -p $HOME/.cache/re2c - # mkdir -p $HOME/.local/opt/re2c - - # echo "PATH=$PATH:$HOME/bin:$(brew --prefix lcov)/bin" >> $GITHUB_ENV - # echo "MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN)" >> $GITHUB_ENV - # echo "CI=true" >> $GITHUB_ENV - # echo "ZEPHIR_PARSER_VERSION=$(head -1 VERSION)" >> $GITHUB_ENV - - # - 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 - # run: .ci/install-re2c.sh - - # - name: Build extensions - # run: | - # phpize - - # if [ "${{ matrix.ccov }}" = "ON" ]; then - # ./configure \ - # --enable-zephir-parser \ - # --enable-zephir-parser-debug \ - # --enable-coverage - # else - # ./configure \ - # --enable-zephir-parser \ - # --enable-zephir-parser-debug - # fi - - # make -j$(getconf _NPROCESSORS_ONLN) - - # - name: Preparing to collect coverage data - # if: matrix.ccov == 'ON' - # run: make coverage-initial - - # - name: Run Tests - # run: | - # php -d extension=./modules/zephir_parser.so --ri zephir_parser - # make test NO_INTERACTION=1 REPORT_EXIT_STATUS=1 - - # - name: Print failures - # if: failure() && runner.os == 'Linux' - # run: .ci/after-failure.sh + steps: + - uses: actions/checkout@v2 - # - name: Capture coverage data - # if: success() && matrix.ccov == 'ON' - # run: make coverage-capture + - name: Install PHP ${{ matrix.php }} + uses: shivammathur/setup-php@v2 + with: + php-version: '${{ matrix.php }}' + coverage: none + env: + PHPTS: ${{ matrix.ts }} - # - name: Prepare Build Artifacts - # working-directory: modules - # run: | - # echo "-- Creating ZIP with Zephir Parser extension" - # zip -rv zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip ./*.so + - name: Build Zephir Parser Extension (Linux) + uses: ./.github/actions/build-linux + if: runner.os == 'Linux' - # - 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 + - name: Prepare Build Artifacts + working-directory: modules + run: | + echo "-- Creating ZIP with Zephir Parser extension" + zip -rv zephir-parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip ./*.so - # - name: Upload Zephir Parser - # uses: actions/upload-artifact@v2 - # with: - # name: zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip - # path: | - # ${{ github.workspace }}/modules/*.zip + - name: Upload Zephir Parser + uses: actions/upload-artifact@v2 + with: + name: zephir-parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip + path: | + ${{ github.workspace }}/modules/*.zip release: if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') From 822e0ef7388971f35ea30295dedd71df3d6bc1d5 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 28 Nov 2021 18:51:58 +0200 Subject: [PATCH 09/39] Fix matrix syntax --- .github/workflows/ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac00da61..dcf70bcb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,11 +35,9 @@ jobs: php: [ '7.0' ] ts: [ 'nts' ] arch: [ 'x64' ] - name: - - ubuntu-gcc - # - macos-clang - # - windows2016-vc15 - # - windows2019-vs16 + + name: + - ubuntu-gcc # matrix names should be in next format: # {php}-{ts}-{os.name}-{compiler}-{arch} From 4e5c44490da28bfc9b7d0c86894bbceb1f22f73c Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 28 Nov 2021 18:53:41 +0200 Subject: [PATCH 10/39] Fix matrix includes --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcf70bcb..1d820755 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,13 +39,13 @@ jobs: name: - ubuntu-gcc - # matrix names should be in next format: - # {php}-{ts}-{os.name}-{compiler}-{arch} - include: - # Linux - - name: ubuntu-gcc - os: ubuntu-18.04 - compiler: gcc + # matrix names should be in next format: + # {php}-{ts}-{os.name}-{compiler}-{arch} + include: + # Linux + - name: ubuntu-gcc + os: ubuntu-18.04 + compiler: gcc steps: - uses: actions/checkout@v2 From 6d76a939ae5b3d1b8e75b92d8a23a39ef22d1c42 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 28 Nov 2021 19:23:35 +0200 Subject: [PATCH 11/39] Add VERSION file to PECL package --- package.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/package.xml b/package.xml index 2f5e33e8..4fdd47f2 100644 --- a/package.xml +++ b/package.xml @@ -206,6 +206,7 @@ + From 3b8a640dff3773a0ddaf42cfcbd3396ab039f62a Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 28 Nov 2021 20:37:57 +0200 Subject: [PATCH 12/39] Use proper gitattributes for phpt files --- .gitattributes | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitattributes b/.gitattributes index 4be68cd3..17ba8f51 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,12 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + *.c linguist-language=C *.h linguist-language=C *.w32 linguist-language=JavaScript *.inc linguist-language=PHP + +# Enable commit diffs for binary PHP test files. Some PHP test files include +# special characters, such as ASCII control characters. Git recognizes these as +# binary and wouldn't generate diffs. +*.phpt diff eol=lf From 8155c0151da790e5f3e9ae718de342437f5d0c34 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 29 Nov 2021 20:02:06 +0200 Subject: [PATCH 13/39] Add macOS to matrix --- .github/actions/build-linux/action.yml | 6 ------ .github/actions/build-mac/action.yml | 30 ++++++++++++++++++++++++++ .github/workflows/ci.yml | 11 ++++++++++ 3 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 .github/actions/build-mac/action.yml diff --git a/.github/actions/build-linux/action.yml b/.github/actions/build-linux/action.yml index 838f4780..77febbcc 100644 --- a/.github/actions/build-linux/action.yml +++ b/.github/actions/build-linux/action.yml @@ -26,9 +26,3 @@ runs: echo "::group::Compile" make -j$(getconf _NPROCESSORS_ONLN) echo "::endgroup::" - - - name: Check Extension - shell: bash - run: | - php -d extension=./modules/zephir_parser.so --ri zephir_parser - make test NO_INTERACTION=1 REPORT_EXIT_STATUS=1 diff --git a/.github/actions/build-mac/action.yml b/.github/actions/build-mac/action.yml new file mode 100644 index 00000000..dcd15e08 --- /dev/null +++ b/.github/actions/build-mac/action.yml @@ -0,0 +1,30 @@ +name: 'Zephir Parser PHP extension build action' +description: 'Build Zephir Parser for macOS according to various PHP versions.' + +runs: + using: 'composite' + steps: + - name: Install RE2C Lexer Generator + shell: bash + run: | + brew install re2c + env: + HOMEBREW_NO_INSTALL_CLEANUP: 1 + + - name: Build Zephir Parser for macOS + shell: bash + working-directory: ${{ github.workspace }} + run: | + echo "::group::Run phpize" + phpize + echo "::endgroup::" + + echo "::group::Run configure" + ./configure \ + --enable-zephir-parser \ + --enable-zephir-parser-debug + echo "::endgroup::" + + echo "::group::Compile" + make -j$(getconf _NPROCESSORS_ONLN) + echo "::endgroup::" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d820755..3bc04adc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,7 @@ jobs: name: - ubuntu-gcc + - macos-clang # matrix names should be in next format: # {php}-{ts}-{os.name}-{compiler}-{arch} @@ -46,6 +47,10 @@ jobs: - name: ubuntu-gcc os: ubuntu-18.04 compiler: gcc + # macOS + - name: macos-clang + os: macos-10.15 + compiler: clang steps: - uses: actions/checkout@v2 @@ -62,6 +67,12 @@ jobs: uses: ./.github/actions/build-linux if: runner.os == 'Linux' + - name: Run Tests for Zephir Parser + shell: bash + run: | + php -d extension=./modules/zephir_parser.so --ri zephir_parser + NO_INTERACTION=1 REPORT_EXIT_STATUS=1 php run-tests.php -q + - name: Prepare Build Artifacts working-directory: modules run: | From 3aa7f3ea455860a2e4595fb0146154e3e1edcf04 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 29 Nov 2021 20:28:05 +0200 Subject: [PATCH 14/39] Add macOS action, fix test cmd --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bc04adc..aa4fe633 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,11 +67,15 @@ jobs: uses: ./.github/actions/build-linux if: runner.os == 'Linux' + - name: Build Zephir Parser Extension (macOS) + uses: ./.github/actions/build-mac + if: runner.os == 'macOS' + - name: Run Tests for Zephir Parser shell: bash run: | php -d extension=./modules/zephir_parser.so --ri zephir_parser - NO_INTERACTION=1 REPORT_EXIT_STATUS=1 php run-tests.php -q + NO_INTERACTION=1 REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=$(which php) php run-tests.php -q - name: Prepare Build Artifacts working-directory: modules From 9d6af412028668d41d4087b723c6386a1101298e Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 29 Nov 2021 21:06:46 +0200 Subject: [PATCH 15/39] Pass extension to tests --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa4fe633..e69d0572 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,7 @@ jobs: shell: bash run: | php -d extension=./modules/zephir_parser.so --ri zephir_parser - NO_INTERACTION=1 REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=$(which php) php run-tests.php -q + NO_INTERACTION=1 REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=$(which php) php -d extension=./modules/zephir_parser.so run-tests.php -q - name: Prepare Build Artifacts working-directory: modules From 90d86f2d3d8049fb46bb7c5f35c7332ead212ffe Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 29 Nov 2021 21:29:04 +0200 Subject: [PATCH 16/39] Add windows extension --- .github/actions/build-win/action.yml | 73 ++++++++++++++++++++++++++++ .github/workflows/ci.yml | 17 +++++++ 2 files changed, 90 insertions(+) create mode 100644 .github/actions/build-win/action.yml diff --git a/.github/actions/build-win/action.yml b/.github/actions/build-win/action.yml new file mode 100644 index 00000000..ead18114 --- /dev/null +++ b/.github/actions/build-win/action.yml @@ -0,0 +1,73 @@ +name: 'Zephir Parser PHP extension build action' +description: 'Build Zephir Parser for Windows according to various PHP versions.' + +inputs: + php_version: + description: 'PHP version to build for (e.g: 7.4, 8.0)' + required: true + ts: + description: 'Thread Safety' + required: false + default: 'nts' + msvc: + description: 'Microsoft Visual C++ compiler toolset prefix (e.g: vc14, vs15, vs16)' + required: true + arch: + description: 'Target architecture (x64, x86)' + required: false + default: 'x64' + +runs: + using: 'composite' + steps: + - name: Install RE2C Lexer Generator + shell: powershell + run: | + mkdir ${{ env.CACHE_DIR }}\Choco + choco install --no-progress -y --cache-location=${{ env.CACHE_DIR }}\Choco re2c + + - name: Setup PHP SDK tool kit + uses: zephir-lang/setup-php-sdk@v1 + with: + php_version: ${{ inputs.php_version }} + ts: ${{ inputs.ts }} + msvc: ${{ inputs.msvc }} + arch: ${{ inputs.arch }} + install_dir: ${{ env.TOOLS_DIR }} + cache_dir: ${{ env.CACHE_DIR }} + + - name: Configure Developer Command Prompt for MSVC compiler + uses: ilammy/msvc-dev-cmd@v1.9.0 + with: + arch: ${{ inputs.arch }} + + - name: Getting Details About Installed PHP + shell: powershell + run: | + Get-Php (Get-Command php).Path + + - name: Phpize + shell: powershell + working-directory: ${{ github.workspace }} + run: | + echo "::group::Run phpize" + phpize + echo "::endgroup::" + + - name: Configure + shell: powershell + working-directory: ${{ github.workspace }} + run: | + echo "::group::Run configure" + .\configure.bat ` + --enable-zephir-parser ` + --enable-zephir-parser-debug + echo "::endgroup::" + + - name: Compile + shell: powershell + working-directory: ${{ github.workspace }} + run: | + echo "::group::Compile" + nmake + echo "::endgroup::" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e69d0572..8f68a08e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,7 @@ jobs: name: - ubuntu-gcc - macos-clang + - windows2016-vc15 # matrix names should be in next format: # {php}-{ts}-{os.name}-{compiler}-{arch} @@ -51,6 +52,10 @@ jobs: - name: macos-clang os: macos-10.15 compiler: clang + # Windows + - name: windows2016-vc15 + os: windows-2016 + compiler: vc15 steps: - uses: actions/checkout@v2 @@ -71,6 +76,18 @@ jobs: uses: ./.github/actions/build-mac if: runner.os == 'macOS' + - name: Build Zephir Parser Extension (Windows) + uses: ./.github/actions/build-win + if: runner.os == 'Windows' + with: + php_version: ${{ matrix.php }} + ts: ${{ matrix.ts }} + msvc: ${{ matrix.compiler }} + arch: ${{ matrix.arch }} + env: + CACHE_DIR: 'C:\Downloads' + TOOLS_DIR: 'C:\tools' + - name: Run Tests for Zephir Parser shell: bash run: | From c86275b9128e5e1d570b166bae76f7dc395d2546 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 29 Nov 2021 21:59:07 +0200 Subject: [PATCH 17/39] Enable parser extension --- .github/actions/build-linux/action.yml | 6 ++++++ .github/actions/build-mac/action.yml | 6 ++++++ .github/actions/build-win/action.yml | 11 +++++++++++ .github/workflows/ci.yml | 13 ++++++++----- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/actions/build-linux/action.yml b/.github/actions/build-linux/action.yml index 77febbcc..4c24bf3c 100644 --- a/.github/actions/build-linux/action.yml +++ b/.github/actions/build-linux/action.yml @@ -26,3 +26,9 @@ runs: echo "::group::Compile" make -j$(getconf _NPROCESSORS_ONLN) echo "::endgroup::" + + - name: Enable Zephir Parser + shell: bash + run: | + cp ./modules/zephir_parser.so $(php -r 'echo ini_get("extension_dir");')/zephir_parser.so + echo "extension=zephir_parser.so" > /etc/php/${{ matrix.php }}/cli/conf.d/20-zephir_parser.ini diff --git a/.github/actions/build-mac/action.yml b/.github/actions/build-mac/action.yml index dcd15e08..812b9294 100644 --- a/.github/actions/build-mac/action.yml +++ b/.github/actions/build-mac/action.yml @@ -28,3 +28,9 @@ runs: echo "::group::Compile" make -j$(getconf _NPROCESSORS_ONLN) echo "::endgroup::" + + - name: Enable Zephir Parser + shell: bash + run: | + cp ./modules/zephir_parser.so $(php -r 'echo ini_get("extension_dir");')/zephir_parser.so + echo "extension=zephir_parser.so" > /etc/php/${{ matrix.php }}/cli/conf.d/20-zephir_parser.ini diff --git a/.github/actions/build-win/action.yml b/.github/actions/build-win/action.yml index ead18114..8a24f8dc 100644 --- a/.github/actions/build-win/action.yml +++ b/.github/actions/build-win/action.yml @@ -71,3 +71,14 @@ runs: echo "::group::Compile" nmake echo "::endgroup::" + + - name: Enable Zephir Parser + shell: powershell + run: | + $OsName = "${{ matrix.os }}".replace('-','').ToLower() + $ReleaseFolder = if ("${{ inputs.ts }}" -eq "ts") { "Release_TS" } else { "Release" } + $ReleaseFolder = if ("${{ inputs.arch }}" -eq "x64") { "x64\${ReleaseFolder}" } else { "${ReleaseFolder}" } + $ReleaseDllPath = "${{ github.workspace }}\${ReleaseFolder}\php_zephir_parser.dll" + + Copy-Item -Path "$ReleaseDllPath" -Destination "${{ env.TOOLS_DIR }}\php\ext\" + Enable-PhpExtension -Extension 'zephir_parser' -Path "${{ env.TOOLS_DIR }}\php" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f68a08e..ecc9cc55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: name: - ubuntu-gcc - macos-clang - - windows2016-vc15 + - windows2016-vc14 # matrix names should be in next format: # {php}-{ts}-{os.name}-{compiler}-{arch} @@ -53,9 +53,9 @@ jobs: os: macos-10.15 compiler: clang # Windows - - name: windows2016-vc15 + - name: windows2016-vc14 os: windows-2016 - compiler: vc15 + compiler: vc14 steps: - uses: actions/checkout@v2 @@ -91,8 +91,11 @@ jobs: - name: Run Tests for Zephir Parser shell: bash run: | - php -d extension=./modules/zephir_parser.so --ri zephir_parser - NO_INTERACTION=1 REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=$(which php) php -d extension=./modules/zephir_parser.so run-tests.php -q + php --ri zephir_parser + TEST_PHP_EXECUTABLE=$(which php) php run-tests.php -q + env: + NO_INTERACTION: 1 + REPORT_EXIT_STATUS: 1 - name: Prepare Build Artifacts working-directory: modules From b4936af601533de2213970daebf45bd89cefbfec Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 29 Nov 2021 22:07:35 +0200 Subject: [PATCH 18/39] Fix extension copying, add php manager --- .github/actions/build-linux/action.yml | 2 +- .github/actions/build-mac/action.yml | 4 ++-- .github/actions/build-win/action.yml | 11 +++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/actions/build-linux/action.yml b/.github/actions/build-linux/action.yml index 4c24bf3c..fac0bf76 100644 --- a/.github/actions/build-linux/action.yml +++ b/.github/actions/build-linux/action.yml @@ -30,5 +30,5 @@ runs: - name: Enable Zephir Parser shell: bash run: | - cp ./modules/zephir_parser.so $(php -r 'echo ini_get("extension_dir");')/zephir_parser.so + sudo cp ./modules/zephir_parser.so "$(php -r 'echo ini_get("extension_dir");')/zephir_parser.so" echo "extension=zephir_parser.so" > /etc/php/${{ matrix.php }}/cli/conf.d/20-zephir_parser.ini diff --git a/.github/actions/build-mac/action.yml b/.github/actions/build-mac/action.yml index 812b9294..e9198521 100644 --- a/.github/actions/build-mac/action.yml +++ b/.github/actions/build-mac/action.yml @@ -32,5 +32,5 @@ runs: - name: Enable Zephir Parser shell: bash run: | - cp ./modules/zephir_parser.so $(php -r 'echo ini_get("extension_dir");')/zephir_parser.so - echo "extension=zephir_parser.so" > /etc/php/${{ matrix.php }}/cli/conf.d/20-zephir_parser.ini + cp ./modules/zephir_parser.so "$(php -r 'echo ini_get("extension_dir");')/zephir_parser.so" + echo "extension=zephir_parser.so" > /usr/local/etc/php/${{ matrix.php }}/cli/conf.d/ext-zephir_parser.ini diff --git a/.github/actions/build-win/action.yml b/.github/actions/build-win/action.yml index 8a24f8dc..e05d4b01 100644 --- a/.github/actions/build-win/action.yml +++ b/.github/actions/build-win/action.yml @@ -26,6 +26,17 @@ runs: mkdir ${{ env.CACHE_DIR }}\Choco choco install --no-progress -y --cache-location=${{ env.CACHE_DIR }}\Choco re2c + - name: Install PHP PowerShell Manager + shell: powershell + run: | + Write-Output "Install PowerShell PHP Manager module" + if (Get-Module -ListAvailable -Name PhpManager) { + Write-Host "PhpManager powershell module exist, skip install" + } else { + Install-Module -Name PhpManager -Repository PSGallery -Force + } + Write-Output "::endgroup::" + - name: Setup PHP SDK tool kit uses: zephir-lang/setup-php-sdk@v1 with: From 3101b9f60c483ab89511f36b3df8449e8c1442e3 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 29 Nov 2021 22:19:43 +0200 Subject: [PATCH 19/39] Add lemon parser for win, fix ini file path --- .github/actions/build-linux/action.yml | 2 +- .github/actions/build-mac/action.yml | 2 +- .github/actions/build-win/action.yml | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-linux/action.yml b/.github/actions/build-linux/action.yml index fac0bf76..d96862f0 100644 --- a/.github/actions/build-linux/action.yml +++ b/.github/actions/build-linux/action.yml @@ -31,4 +31,4 @@ runs: shell: bash run: | sudo cp ./modules/zephir_parser.so "$(php -r 'echo ini_get("extension_dir");')/zephir_parser.so" - echo "extension=zephir_parser.so" > /etc/php/${{ matrix.php }}/cli/conf.d/20-zephir_parser.ini + sudo echo "extension=zephir_parser.so" > /etc/php/${{ matrix.php }}/cli/conf.d/20-zephir_parser.ini diff --git a/.github/actions/build-mac/action.yml b/.github/actions/build-mac/action.yml index e9198521..176c5f15 100644 --- a/.github/actions/build-mac/action.yml +++ b/.github/actions/build-mac/action.yml @@ -33,4 +33,4 @@ runs: shell: bash run: | cp ./modules/zephir_parser.so "$(php -r 'echo ini_get("extension_dir");')/zephir_parser.so" - echo "extension=zephir_parser.so" > /usr/local/etc/php/${{ matrix.php }}/cli/conf.d/ext-zephir_parser.ini + echo "extension=zephir_parser.so" > /usr/local/etc/php/${{ matrix.php }}/conf.d/ext-zephir_parser.ini diff --git a/.github/actions/build-win/action.yml b/.github/actions/build-win/action.yml index e05d4b01..5c40bcc8 100644 --- a/.github/actions/build-win/action.yml +++ b/.github/actions/build-win/action.yml @@ -37,6 +37,11 @@ runs: } Write-Output "::endgroup::" + - name: Compile Lemon Parser + shell: powershell + run: | + .\.ci\lemon-parser.ps1 + - name: Setup PHP SDK tool kit uses: zephir-lang/setup-php-sdk@v1 with: From 1875026bd497d4b931a18e32ee5b39e92f50bf73 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 29 Nov 2021 22:42:49 +0200 Subject: [PATCH 20/39] Fix env vars, use copy files for linux ini file --- .github/actions/build-linux/action.yml | 3 ++- .github/workflows/ci.yml | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-linux/action.yml b/.github/actions/build-linux/action.yml index d96862f0..93db846c 100644 --- a/.github/actions/build-linux/action.yml +++ b/.github/actions/build-linux/action.yml @@ -31,4 +31,5 @@ runs: shell: bash run: | sudo cp ./modules/zephir_parser.so "$(php -r 'echo ini_get("extension_dir");')/zephir_parser.so" - sudo echo "extension=zephir_parser.so" > /etc/php/${{ matrix.php }}/cli/conf.d/20-zephir_parser.ini + echo "extension=zephir_parser.so" > ./ext-zephir_parser.ini + sudo cp ./ext-zephir_parser.ini /etc/php/${{ matrix.php }}/cli/conf.d/20-zephir_parser.ini diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ecc9cc55..37a18795 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,7 +92,11 @@ jobs: shell: bash run: | php --ri zephir_parser - TEST_PHP_EXECUTABLE=$(which php) php run-tests.php -q + if [ "${{ runner.os }}" -eq 'Windows' ]; then + TEST_PHP_EXECUTABLE=C:\tools\php\php.exe php run-tests.php -q + else + TEST_PHP_EXECUTABLE=$(which php) php run-tests.php -q + fi env: NO_INTERACTION: 1 REPORT_EXIT_STATUS: 1 From 89dd6d0631de99e883d660fd3bd100490e96a26a Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 29 Nov 2021 22:49:41 +0200 Subject: [PATCH 21/39] Fix shell syntax --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37a18795..80f6d341 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ env: jobs: builds: - name: build / PHP-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }} + name: PHP-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }} runs-on: ${{ matrix.os }} strategy: @@ -92,7 +92,7 @@ jobs: shell: bash run: | php --ri zephir_parser - if [ "${{ runner.os }}" -eq 'Windows' ]; then + if [ "${{ runner.os }}" = "Windows" ]; then TEST_PHP_EXECUTABLE=C:\tools\php\php.exe php run-tests.php -q else TEST_PHP_EXECUTABLE=$(which php) php run-tests.php -q From 97232ba55f6f55b13079a9a6ecb0b2a47836d966 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Thu, 2 Dec 2021 23:00:48 +0200 Subject: [PATCH 22/39] Set env var for php tests --- .github/workflows/ci.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80f6d341..d7b7bc97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,15 +88,20 @@ jobs: CACHE_DIR: 'C:\Downloads' TOOLS_DIR: 'C:\tools' - - name: Run Tests for Zephir Parser + - name: Setup Tests shell: bash run: | - php --ri zephir_parser if [ "${{ runner.os }}" = "Windows" ]; then - TEST_PHP_EXECUTABLE=C:\tools\php\php.exe php run-tests.php -q + echo "TEST_PHP_EXECUTABLE=C:\tools\php\php.exe" >> $GITHUB_ENV else - TEST_PHP_EXECUTABLE=$(which php) php run-tests.php -q + echo "TEST_PHP_EXECUTABLE=$(which php)" >> $GITHUB_ENV fi + + - name: Run Tests for Zephir Parser + shell: bash + run: | + php --ri zephir_parser + php run-tests.php -q env: NO_INTERACTION: 1 REPORT_EXIT_STATUS: 1 From 077393664b65727781acb0ff50f02b674fe9e1bb Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Fri, 3 Dec 2021 17:40:51 +0200 Subject: [PATCH 23/39] Fix artifacts upload step --- .github/actions/build-win/action.yml | 3 +-- .github/workflows/ci.yml | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/actions/build-win/action.yml b/.github/actions/build-win/action.yml index 5c40bcc8..e7ac5e61 100644 --- a/.github/actions/build-win/action.yml +++ b/.github/actions/build-win/action.yml @@ -29,7 +29,7 @@ runs: - name: Install PHP PowerShell Manager shell: powershell run: | - Write-Output "Install PowerShell PHP Manager module" + Write-Output "::group::Install PowerShell PHP Manager module" if (Get-Module -ListAvailable -Name PhpManager) { Write-Host "PhpManager powershell module exist, skip install" } else { @@ -91,7 +91,6 @@ runs: - name: Enable Zephir Parser shell: powershell run: | - $OsName = "${{ matrix.os }}".replace('-','').ToLower() $ReleaseFolder = if ("${{ inputs.ts }}" -eq "ts") { "Release_TS" } else { "Release" } $ReleaseFolder = if ("${{ inputs.arch }}" -eq "x64") { "x64\${ReleaseFolder}" } else { "${ReleaseFolder}" } $ReleaseDllPath = "${{ github.workspace }}\${ReleaseFolder}\php_zephir_parser.dll" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7b7bc97..fc8d38b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,18 +106,26 @@ jobs: NO_INTERACTION: 1 REPORT_EXIT_STATUS: 1 - - name: Prepare Build Artifacts - working-directory: modules + - name: Collect Build Artifacts + shell: bash run: | - echo "-- Creating ZIP with Zephir Parser extension" - zip -rv zephir-parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip ./*.so + echo "::group::Creating ZIP with Zephir Parser extension" + if [ "${{ runner.os }}" = "Windows" ]; then + EXTENSION="$(find .\x64 -type f -name 'php_zephir_parser.dll')" + else + EXTENSION="$(find ./modules -type f -name 'zephir_parser.so')" + fi + + zip -rvj zephir-parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip \ + $EXTENSION VERSION LICENSE CREDITS NO_WARRANTY CHANGELOG.md + echo "::endgroup::" - name: Upload Zephir Parser uses: actions/upload-artifact@v2 with: name: zephir-parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip path: | - ${{ github.workspace }}/modules/*.zip + ${{ github.workspace }}/zephir-parser-*.zip release: if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') From f63c4100c72a58310c061aa669a8f85c6d890b66 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Fri, 3 Dec 2021 17:48:59 +0200 Subject: [PATCH 24/39] Use unix like path for bash windows --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc8d38b6..94341954 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,7 +111,7 @@ jobs: run: | echo "::group::Creating ZIP with Zephir Parser extension" if [ "${{ runner.os }}" = "Windows" ]; then - EXTENSION="$(find .\x64 -type f -name 'php_zephir_parser.dll')" + EXTENSION="$(find ./x64 -type f -name 'php_zephir_parser.dll')" else EXTENSION="$(find ./modules -type f -name 'zephir_parser.so')" fi From d79b6848e678364494bd64e794d33ff53acf54c4 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Dec 2021 12:35:58 +0200 Subject: [PATCH 25/39] Try to upgrade to win2019 --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94341954..9b19d968 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,6 @@ env: PHP_SDK_VERSION: 2.2.0 PHP_DEVPACK: C:\tools\php-devpack PHP_SDK_PATH: C:\tools\php-sdk - EXTENSION_FILE: php_zephir_parser.dll jobs: builds: @@ -54,7 +53,7 @@ jobs: compiler: clang # Windows - name: windows2016-vc14 - os: windows-2016 + os: windows-2019 compiler: vc14 steps: From deaa9156b34059a65cd146447f46c593e71e3c77 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Dec 2021 13:13:37 +0200 Subject: [PATCH 26/39] Try mixed matrix --- .github/workflows/ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b19d968..7eff62da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,14 +31,14 @@ jobs: fail-fast: false matrix: # php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ] - php: [ '7.0' ] + php: [ '7.0', '8.0' ] ts: [ 'nts' ] arch: [ 'x64' ] name: - ubuntu-gcc - macos-clang - - windows2016-vc14 + # - windows2019-vc14 # matrix names should be in next format: # {php}-{ts}-{os.name}-{compiler}-{arch} @@ -52,9 +52,11 @@ jobs: os: macos-10.15 compiler: clang # Windows - - name: windows2016-vc14 - os: windows-2019 - compiler: vc14 + # - name: windows2019-vc14 + # os: windows-2019 + # compiler: vc14 + - { php: '7.0', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14' } + - { php: '8.0', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } steps: - uses: actions/checkout@v2 From 1b18d8480b272cce15e78b888d4c173c08d87250 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Dec 2021 13:17:03 +0200 Subject: [PATCH 27/39] Add full matrix opts to mixed matrix --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7eff62da..408befee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,8 +55,8 @@ jobs: # - name: windows2019-vc14 # os: windows-2019 # compiler: vc14 - - { php: '7.0', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14' } - - { php: '8.0', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } + - { php: '7.0', ts: 'nts', arch: 'x64', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14' } + - { php: '8.0', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } steps: - uses: actions/checkout@v2 From d84905cd7e6bf4b0abb239164ce966d27f71b2fe Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Dec 2021 13:29:10 +0200 Subject: [PATCH 28/39] Enable full matrix --- .github/workflows/ci.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 408befee..aaed86f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,33 +30,29 @@ jobs: strategy: fail-fast: false matrix: - # php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ] - php: [ '7.0', '8.0' ] + php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ] ts: [ 'nts' ] arch: [ 'x64' ] name: - ubuntu-gcc - macos-clang - # - windows2019-vc14 # matrix names should be in next format: # {php}-{ts}-{os.name}-{compiler}-{arch} include: # Linux - - name: ubuntu-gcc - os: ubuntu-18.04 - compiler: gcc + - { name: ubuntu-gcc, os: ubuntu-18.04, compiler: gcc } # macOS - - name: macos-clang - os: macos-10.15 - compiler: clang + - { name: macos-clang, os: macos-10.15, compiler: clang } # Windows - # - name: windows2019-vc14 - # os: windows-2019 - # compiler: vc14 - { php: '7.0', ts: 'nts', arch: 'x64', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14' } + - { php: '7.1', ts: 'nts', arch: 'x64', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14' } + - { php: '7.2', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } + - { php: '7.3', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } + - { php: '7.4', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } - { php: '8.0', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } + - { php: '8.1', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } steps: - uses: actions/checkout@v2 From 0f2a378da33c67b575610db326c10bd23431a331 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Dec 2021 13:52:36 +0200 Subject: [PATCH 29/39] Fix msvc compiler version for php 7.4 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aaed86f0..8435c4ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: - { php: '7.1', ts: 'nts', arch: 'x64', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14' } - { php: '7.2', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } - { php: '7.3', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } - - { php: '7.4', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } + - { php: '7.4', ts: 'nts', arch: 'x64', name: 'windows2019-vs15', os: 'windows-2019', compiler: 'vs15' } - { php: '8.0', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } - { php: '8.1', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } @@ -98,7 +98,7 @@ jobs: shell: bash run: | php --ri zephir_parser - php run-tests.php -q + php run-tests.php -q; exit $? env: NO_INTERACTION: 1 REPORT_EXIT_STATUS: 1 From 618e3ef39f2207d50b51fb271af49d9cae0901ce Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Dec 2021 14:01:12 +0200 Subject: [PATCH 30/39] Fix msvc compiler prefix for php 7.4 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8435c4ae..9ee136b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: - { php: '7.1', ts: 'nts', arch: 'x64', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14' } - { php: '7.2', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } - { php: '7.3', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } - - { php: '7.4', ts: 'nts', arch: 'x64', name: 'windows2019-vs15', os: 'windows-2019', compiler: 'vs15' } + - { php: '7.4', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } - { php: '8.0', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } - { php: '8.1', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } From 867a1bc52975ad6ba913de40ce7b164e7d8ff029 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Dec 2021 22:29:10 +0200 Subject: [PATCH 31/39] Try to set compatible toolser for php 7.4 --- .github/actions/build-win/action.yml | 11 +++++++++++ .github/workflows/ci.yml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-win/action.yml b/.github/actions/build-win/action.yml index e7ac5e61..fbd71845 100644 --- a/.github/actions/build-win/action.yml +++ b/.github/actions/build-win/action.yml @@ -53,10 +53,21 @@ runs: cache_dir: ${{ env.CACHE_DIR }} - name: Configure Developer Command Prompt for MSVC compiler + if: ${{ matrix.php }} != '7.4' uses: ilammy/msvc-dev-cmd@v1.9.0 with: arch: ${{ inputs.arch }} + # Workaround for + # PHP Warning: PHP Startup: Can't load module 'C:\tools\php\ext\php_zephir_parser.dll' + # as it's linked with 14.29, but the core is linked with 14.16 in Unknown on line 0 + - name: Configure Developer Command Prompt for MSVC compiler + if: ${{ matrix.php }} == '7.4' + uses: ilammy/msvc-dev-cmd@v1.9.0 + with: + arch: ${{ inputs.arch }} + toolset: 14.16 + - name: Getting Details About Installed PHP shell: powershell run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ee136b8..2438423b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: - { php: '7.1', ts: 'nts', arch: 'x64', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14' } - { php: '7.2', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } - { php: '7.3', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } - - { php: '7.4', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } + - { php: '7.4', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } - { php: '8.0', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } - { php: '8.1', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } From a30962ea6ea001f796074e98d47af53ae820c345 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Dec 2021 23:38:31 +0200 Subject: [PATCH 32/39] Fix condition for msvc toolset --- .github/actions/build-win/action.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/actions/build-win/action.yml b/.github/actions/build-win/action.yml index fbd71845..18c6a6e7 100644 --- a/.github/actions/build-win/action.yml +++ b/.github/actions/build-win/action.yml @@ -53,8 +53,7 @@ runs: cache_dir: ${{ env.CACHE_DIR }} - name: Configure Developer Command Prompt for MSVC compiler - if: ${{ matrix.php }} != '7.4' - uses: ilammy/msvc-dev-cmd@v1.9.0 + uses: ilammy/msvc-dev-cmd@v1.10.0 with: arch: ${{ inputs.arch }} @@ -62,8 +61,8 @@ runs: # PHP Warning: PHP Startup: Can't load module 'C:\tools\php\ext\php_zephir_parser.dll' # as it's linked with 14.29, but the core is linked with 14.16 in Unknown on line 0 - name: Configure Developer Command Prompt for MSVC compiler - if: ${{ matrix.php }} == '7.4' - uses: ilammy/msvc-dev-cmd@v1.9.0 + uses: ilammy/msvc-dev-cmd@v1.10.0 + if: matrix.php == '7.4' with: arch: ${{ inputs.arch }} toolset: 14.16 From 133504bef5f1681d8f4c26174ee4dd5a166bc787 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Dec 2021 23:53:23 +0200 Subject: [PATCH 33/39] Use conditional php ver from inputs var --- .github/actions/build-win/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-win/action.yml b/.github/actions/build-win/action.yml index 18c6a6e7..34aca93b 100644 --- a/.github/actions/build-win/action.yml +++ b/.github/actions/build-win/action.yml @@ -62,7 +62,7 @@ runs: # as it's linked with 14.29, but the core is linked with 14.16 in Unknown on line 0 - name: Configure Developer Command Prompt for MSVC compiler uses: ilammy/msvc-dev-cmd@v1.10.0 - if: matrix.php == '7.4' + if: ${{ inputs.php_version }} == '7.4' with: arch: ${{ inputs.arch }} toolset: 14.16 From 29069f3fb7f4957130d4a7b492b4c9b32495295d Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Dec 2021 19:44:32 +0200 Subject: [PATCH 34/39] Add pecl package --- .github/workflows/ci.yml | 68 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2438423b..6e33b3d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,10 +124,76 @@ jobs: path: | ${{ github.workspace }}/zephir-parser-*.zip + pecl: + name: Build PECL package + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + tools: pecl + + - name: Install System Dependencies + run: | + sudo apt-get update --quiet --yes 1>/dev/null + sudo apt-get install --no-install-recommends -q -y re2c + + - name: Build Zephir Parser + run: | + echo "::group::Run phpize" + phpize + echo "::endgroup::" + + echo "::group::Run configure" + ./configure \ + --enable-zephir-parser \ + --enable-zephir-parser-debug + echo "::endgroup::" + + echo "::group::Compile" + make -j$(getconf _NPROCESSORS_ONLN) + echo "::endgroup::" + + - name: Prepare PECL package config + shell: pwsh + run: | + echo "-- Replacing Release data" + $Config = [xml](Get-Content ./package.xml) + $Config.package.date = $(Get-Date -Format "yyyy-MM-dd") + $Config.package.time = $(Get-Date -Format "HH:mm:ss") + $Config.package.version.Item(1).release = $(Get-Content ./VERSION) + $Config.package.version.Item(1).api = $Config.package.version.release + + echo "-- Parsing CHANGELOG" + ./.ci/release-notes.sh ./CHANGELOG.md > ./release-notes.md + $Config.package.notes = $(Get-Content ./release-notes.md -Encoding UTF8 -Raw) + $Config.Save('./package.xml') + + - name: Create PECL package + run: | + pecl package + zephir_parser_package="`ls | grep zephir_parser-*tgz`" + mv $zephir_parser_package zephir_parser-pecl.tgz + + - name: Validate PECL Package + run: | + pecl package-validate zephir_parser-pecl.tgz + pecl info zephir_parser-pecl.tgz + + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: 'zephir_parser-pecl' + path: zephir_parser-pecl.tgz + release: if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - needs: [ builds ] + needs: [ builds, pecl ] name: Create Release runs-on: ubuntu-20.04 From 44780b57a002dfc0dca019da785def4a6d95fe52 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Dec 2021 20:26:17 +0200 Subject: [PATCH 35/39] Remove old files, add fail scenario --- .ci/release-notes.sh | 10 - .ci/win-ci-tools.psm1 | 417 --------------------------- .github/actions/build-win/action.yml | 6 +- .github/workflows/ci.yml | 26 +- 4 files changed, 30 insertions(+), 429 deletions(-) delete mode 100644 .ci/win-ci-tools.psm1 diff --git a/.ci/release-notes.sh b/.ci/release-notes.sh index 03492db3..53b564bc 100755 --- a/.ci/release-notes.sh +++ b/.ci/release-notes.sh @@ -22,14 +22,4 @@ startline=$(cat "$1" | grep -nE '^### ' | head -n 1 | cut -d ":" -f 1) finishline=$(($(cat "$1" | grep -nE '^## \[[0-9]+' | head -n 2 | tail -n 1 | cut -d ":" -f 1) - 1)) changelog=$(sed -n "${startline},${finishline}p" "$1"); - -: "${GITHUB_ACTIONS:=0}" - -if [ "$GITHUB_ACTIONS" = "true" ] -then - changelog="${changelog//'%'/'%25'}" - changelog="${changelog//$'\n'/'%0A'}" - changelog="${changelog//$'\r'/'%0D'}" -fi - echo "${changelog}" diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 deleted file mode 100644 index 2d63a637..00000000 --- a/.ci/win-ci-tools.psm1 +++ /dev/null @@ -1,417 +0,0 @@ -# This file is part of the Zephir Parser. -# -# (c) Zephir Team -# -# For the full copyright and license information, please view -# the LICENSE file that was distributed with this source code. - -function SetupCommonEnvironment { - <# - .SYNOPSIS - Creates common directories if not exists - #> - - $CommonPath = "C:\Downloads", "C:\Downloads\Choco" - - foreach ($path in $CommonPath) { - if (-not (Test-Path $path)) { - New-Item -ItemType Directory -Force -Path $path | Out-Null - } - } - - # Hide "You are in 'detached HEAD' state" message - git config --global advice.detachedHead false -} - -function InitializeReleaseVars { - <# - .SYNOPSIS - Configures Environment variables for Release build. - #> - - # Build artifacts should be names like this: - # zephir-parser-php-7.0-nts-win32-vc14-x86.zip - # zephir-parser-php-7.0-ts-win32-vc14-x64.zip - - $VC_Prefix = "vc" - if (${env:VC_VERSION} -ge 16) { - $VC_Prefix = "vc" - } - - # Configure for Windows define `BUILD_DIR` using the next logic: - # - # Release ZTS x86 => Release_TS\php_zephir_parser.dll - # Release NTS x86 => Release\php_zephir_parser.dll - # Release ZTS x64 => x64\Release_TS\php_zephir_parser.dll - # Release NTS x64 => x64\Release\php_zephir_parser.dll - - $env:RELEASE_FOLDER = "Release" - if (${env:BUILD_TYPE} -eq 'ts') { - $env:RELEASE_FOLDER = -join($env:RELEASE_FOLDER, "_TS") - } - - if (${env:PHP_ARCH} -eq 'x64') { - $env:RELEASE_FOLDER = -join("x64\", $env:RELEASE_FOLDER) - } - - $env:RELEASE_DLL_PATH = "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}\${env:EXTENSION_FILE}" - $env:RELEASE_ZIPBALL = "zephir-parser-php-${env:PHP_MINOR}-${env:BUILD_TYPE}-win32-${VC_Prefix}${env:VC_VERSION}-${env:PHP_ARCH}" - - Write-Output "RELEASE_FOLDER=${env:RELEASE_FOLDER}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - Write-Output "RELEASE_ZIPBALL=${env:RELEASE_ZIPBALL}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - Write-Output "RELEASE_DLL_PATH=${env:RELEASE_DLL_PATH}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -} - -function InstallPhpSdk { - <# - .SYNOPSIS - Install PHP SDK binary tools from sources. - #> - - Write-Output "Install PHP SDK binary tools: ${env:PHP_SDK_VERSION}" - - $PhpSdk = "php-sdk-${env:PHP_SDK_VERSION}.zip" - $RemoteUrl = "https://github.com/microsoft/php-sdk-binary-tools/archive/${PhpSdk}" - $DestinationPath = "C:\Downloads\${PhpSdk}" - - if (-not (Test-Path $env:PHP_SDK_PATH)) { - if (-not [System.IO.File]::Exists($DestinationPath)) { - Write-Output "Downloading PHP SDK binary tools: $RemoteUrl ..." - DownloadFile $RemoteUrl $DestinationPath - } - - $DestinationUnzipPath = "${env:Temp}\php-sdk-binary-tools-php-sdk-${env:PHP_SDK_VERSION}" - - if (-not (Test-Path "$DestinationUnzipPath")) { - Expand-Item7zip $DestinationPath $env:Temp - } - - Move-Item -Path $DestinationUnzipPath -Destination $env:PHP_SDK_PATH - } -} - -function InstallPhpDevPack { - <# - .SYNOPSIS - Intstall PHP Developer pack from sources. - #> - - Write-Output "Install PHP Dev pack: ${env:PHP_VERSION}" - - $TS = Get-ThreadSafety - - if ($env:VC_VERSION -gt 15) { - $VSPrefix = "VS" - $VSPrefixSmall = "vs" - } else { - $VSPrefix = "VC" - $VSPrefixSmall = "vc" - } - - $BaseUrl = "http://windows.php.net/downloads/releases" - $DevPack = "php-devel-pack-${env:PHP_VERSION}${TS}-Win32-${VSPrefixSmall}${env:VC_VERSION}-${env:PHP_ARCH}.zip" - - $RemoteUrl = "${BaseUrl}/${DevPack}" - $RemoteArchiveUrl = "${BaseUrl}/archives/${DevPack}" - $DestinationPath = "C:\Downloads\php-devel-pack-${env:PHP_VERSION}${TS}-${VSPrefix}${env:VC_VERSION}-${env:PHP_ARCH}.zip" - - if (-not (Test-Path $env:PHP_DEVPACK)) { - if (-not [System.IO.File]::Exists($DestinationPath)) { - DownloadFileUsingAlternative -RemoteUrl $RemoteUrl ` - -RemoteArchiveUrl $RemoteArchiveUrl ` - -DestinationPath $DestinationPath ` - -Message "Downloading PHP Dev pack" - } - - $DestinationUnzipPath = "${env:Temp}\php-${env:PHP_VERSION}-devel-${VSPrefix}${env:VC_VERSION}-${env:PHP_ARCH}" - - if (-not (Test-Path "$DestinationUnzipPath")) { - Expand-Item7zip $DestinationPath $env:Temp - } - - Move-Item -Path $DestinationUnzipPath -Destination $env:PHP_DEVPACK - } -} - -function DownloadFileUsingAlternative { - <# - .SYNOPSIS - Downloads files from URL using alternative ULR if primary URL not found - #> - - [CmdletBinding()] - param( - [parameter(Mandatory = $true, ValueFromPipeline = $true)] [ValidateNotNullOrEmpty()] [System.String] $RemoteUrl, - [parameter(Mandatory = $true, ValueFromPipeline = $true)] [ValidateNotNullOrEmpty()] [System.String] $RemoteArchiveUrl, - [parameter(Mandatory = $true, ValueFromPipeline = $true)] [ValidateNotNullOrEmpty()] [System.String] $DestinationPath, - [parameter(Mandatory = $true, ValueFromPipeline = $true)] [ValidateNotNullOrEmpty()] [System.String] $Message - ) - - process { - try { - Write-Output "${Message}: ${RemoteUrl} ..." - DownloadFile $RemoteUrl $DestinationPath - } catch [System.Net.WebException] { - Write-Output "${Message} from archive: ${RemoteArchiveUrl} ..." - DownloadFile $RemoteArchiveUrl $DestinationPath - } - } -} - -function DownloadFile { - <# - .SYNOPSIS - Downloads file from providing URL to specified destionation. - - .NOTES - Throws System.Net.WebException if $RequestUrl not found. - #> - - [CmdletBinding()] - param( - [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [System.String] $RemoteUrl, - [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [System.String] $DestinationPath - ) - - process { - $RetryMax = 5 - $RetryCount = 0 - $Completed = $false - - $WebClient = New-Object System.Net.WebClient - $WebClient.Headers.Add('User-Agent', 'GitHub Actions PowerShell Script') - - while (-not $Completed -or $RetryCount -eq $RetryMax) { - try { - $WebClient.DownloadFile($RemoteUrl, $DestinationPath) - $Completed = $true - } catch [System.Net.WebException] { - $ErrorMessage = $_.Exception.Message - - if ($_.Exception.Response.StatusCode -eq 404) { - Write-Warning -Message "Error downloading ${RemoteUrl}: $ErrorMessage" - throw [System.Net.WebException] "Error downloading ${RemoteUrl}" - } - - if ($RetryCount -ge $RetryMax) { - Write-Output "Error downloading ${RemoteUrl}: $ErrorMessage" - $Completed = $true - } else { - $RetryCount++ - } - } - } - } -} - -function Expand-Item7zip { - <# - .SYNOPSIS - Extracts ZIP archives to specified directory - #> - - param( - [Parameter(Mandatory = $true)] [System.String] $Archive, - [Parameter(Mandatory = $true)] [System.String] $Destination - ) - - if (-not (Test-Path -Path $Archive -PathType Leaf)) { - throw "Specified archive File is invalid: [$Archive]" - } - - if (-not (Test-Path -Path $Destination -PathType Container)) { - New-Item $Destination -ItemType Directory | Out-Null - } - - $Result = (& 7z x "$Archive" "-o$Destination" -aoa -bd -y -r) - - if ($LastExitCode -ne 0) { - Write-Output "An error occurred while unzipping [$Archive] to [$Destination]. Error code was: ${LastExitCode}" - Exit $LastExitCode - } -} - -function Get-ThreadSafety { - <# - .SYNOPSIS - Detects if Build is Thread Safety or not and returns `ts` suffix. - #> - - if ($env:BUILD_TYPE -Match "nts") { - return "-nts" - } - - return [string]::Empty -} - -function AppendSessionPath { - [string[]] $PathsCollection = @( - "${Env:VSCOMNTOOLS}\..\..\VC", - "C:\Program Files (x86)\Microsoft Visual Studio ${Env:VC_VERSION}.0\VC", - "C:\Program Files (x86)\Microsoft Visual Studio ${Env:VC_VERSION}.0\VC\bin", - "${Env:VSCOMNTOOLS}", - "C:\php" - "C:\php\bin" - "C:\php-sdk\bin", - "C:\php-devpack" - ) - - $CurrentPath = (Get-Item -Path ".\" -Verbose).FullName - - ForEach ($PathItem In $PathsCollection) { - Set-Location Env: - $AllPaths = (Get-ChildItem Path).value.split(";") | Sort-Object -Unique - $AddToPath = $true - - ForEach ($AddedPath In $AllPaths) { - If (-not "${AddedPath}") { - continue - } - - $AddedPath = $AddedPath -replace '\\$', '' - - If ($PathItem -eq $AddedPath) { - $AddToPath = $false - } - } - - If ($AddToPath) { - $Env:Path += ";$PathItem" - } - } - - Set-Location "${CurrentPath}" -} - -function EnableExtension { - <# - .SYNOPSIS - Enables PHP Extension. - #> - - if (-not (Test-Path env:RELEASE_DLL_PATH)) { - InitializeReleaseVars - } - - if (-not (Test-Path "${env:RELEASE_DLL_PATH}")) { - throw "Unable to locate extension path: ${env:RELEASE_DLL_PATH}" - } - - Copy-Item -Path "${env:RELEASE_DLL_PATH}" -Destination "${env:PHPROOT}\ext\" - - Enable-PhpExtension -Extension zephir_parser -Path "${env:PHPROOT}" -} - -function PrepareReleasePackage { - param ( - [Parameter(Mandatory=$true)] [System.String] $PhpVersion, - [Parameter(Mandatory=$true)] [System.String] $BuildType, - [Parameter(Mandatory=$true)] [System.String] $Platform, - [Parameter(Mandatory=$false)] [System.String] $ZipballName = '', - [Parameter(Mandatory=$false)] [System.String[]] $ReleaseFiles = @(), - [Parameter(Mandatory=$false)] [System.String] $ReleaseFile = 'RELEASE.txt', - [Parameter(Mandatory=$false)] [System.Boolean] $ConvertMd2Html = $false, - [Parameter(Mandatory=$false)] [System.String] $BasePath = '.' - ) - - $BasePath = Resolve-Path $BasePath - $ReleaseDirectory = "${Env:GITHUB_ACTOR}-${Env:RUNNER_OS}-${Env:GITHUB_JOB}-${Env:GITHUB_RUN_NUMBER}" - - Write-Output "ReleaseDirectory: ${ReleaseDirectory}" - - PrepareReleaseNote ` - -PhpVersion $PhpVersion ` - -BuildType $BuildType ` - -Platform $Platform ` - -ReleaseFile $ReleaseFile ` - -ReleaseDirectory $ReleaseDirectory ` - -BasePath $BasePath - - $ReleaseDestination = "${BasePath}\${ReleaseDirectory}" - - $CurrentPath = Resolve-Path '.' - - if ($ConvertMd2Html) { - FormatReleaseFiles -ReleaseDirectory $ReleaseDirectory - } - - if ($ReleaseFiles.count -gt 0) { - foreach ($File in $ReleaseFiles) { - Copy-Item "${File}" "${ReleaseDestination}" - Write-Debug "Copy ${File} to ${ReleaseDestination}" - } - } - - if (!$ZipballName) { - if (!$Env:RELEASE_ZIPBALL) { - throw "Required parameter `"ZipballName`" is missing" - } else { - $ZipballName = $Env:RELEASE_ZIPBALL; - } - } - - Set-Location "${ReleaseDestination}" - $Output = (& 7z a "${ZipballName}.zip" *) - $ExitCode = $LASTEXITCODE - - $DirectoryContents = Get-ChildItem -Path "${ReleaseDestination}" - Write-Debug ($DirectoryContents | Out-String) - - if ($ExitCode -ne 0) { - Set-Location "${CurrentPath}" - throw "An error occurred while creating release zipball: `"${ZipballName}`". ${Output}" - } - - Move-Item "${ZipballName}.zip" -Destination "${BasePath}" - Write-Output "Release file created: ${BasePath}\${ZipballName}.zip" - Set-Location "${CurrentPath}" -} - -function PrepareReleaseNote { - param ( - [Parameter(Mandatory=$true)] [System.String] $PhpVersion, - [Parameter(Mandatory=$true)] [System.String] $BuildType, - [Parameter(Mandatory=$true)] [System.String] $Platform, - [Parameter(Mandatory=$false)] [System.String] $ReleaseFile, - [Parameter(Mandatory=$false)] [System.String] $ReleaseDirectory, - [Parameter(Mandatory=$false)] [System.String] $BasePath - ) - - $Destination = "${BasePath}\${ReleaseDirectory}" - - if (-not (Test-Path $Destination)) { - New-Item -ItemType Directory -Force -Path "${Destination}" | Out-Null - } - - $ReleaseFile = "${Destination}\${ReleaseFile}" - $ReleaseDate = Get-Date -Format o - - $Version = Get-Content (Join-Path -Path ${BasePath} -ChildPath 'VERSION') -First 1 - - Write-Output "Release date: ${ReleaseDate}" | Out-File -Encoding "ASCII" -Append "${ReleaseFile}" - Write-Output "Release version: ${Version}" | Out-File -Encoding "ASCII" -Append "${ReleaseFile}" - Write-Output "Git commit: ${Env:GITHUB_SHA}" | Out-File -Encoding "ASCII" -Append "${ReleaseFile}" - Write-Output "Build type: ${BuildType}" | Out-File -Encoding "ASCII" -Append "${ReleaseFile}" - Write-Output "Platform: ${Platform}" | Out-File -Encoding "ASCII" -Append "${ReleaseFile}" - Write-Output "Target PHP version: ${PhpVersion}" | Out-File -Encoding "ASCII" -Append "${ReleaseFile}" -} - -function FormatReleaseFiles { - param ( - [Parameter(Mandatory=$true)] [System.String] $ReleaseDirectory, - [Parameter(Mandatory=$false)] [System.String] $BasePath = '.' - ) - - $CurrentPath = (Get-Item -Path ".\" -Verbose).FullName - - $BasePath = Resolve-Path $BasePath - Set-Location "${BasePath}" - - Get-ChildItem (Get-Item -Path ".\" -Verbose).FullName *.md | - ForEach-Object{ - $BaseName = $_.BaseName - pandoc -f markdown -t html5 "${BaseName}.md" > "${BasePath}\${ReleaseDirectory}\${BaseName}.html" - } - - Set-Location "${CurrentPath}" -} diff --git a/.github/actions/build-win/action.yml b/.github/actions/build-win/action.yml index 34aca93b..e7faacb1 100644 --- a/.github/actions/build-win/action.yml +++ b/.github/actions/build-win/action.yml @@ -86,7 +86,11 @@ runs: run: | echo "::group::Run configure" .\configure.bat ` - --enable-zephir-parser ` + --with-codegen-arch=yes ` + --with-prefix=${{ env.TOOLS_DIR }}\php ` + --with-php-build=${{ env.TOOLS_DIR }}\php-devpack ` + --disable-all ` + --enable-zephir-parser=shared ` --enable-zephir-parser-debug echo "::endgroup::" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e33b3d4..d94260d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,6 +124,30 @@ jobs: path: | ${{ github.workspace }}/zephir-parser-*.zip + - name: Check for Errors + if: always() + shell: pwsh + run: | + Get-ChildItem (Get-Item -Path "./" -Verbose).FullName *.log | + ForEach-Object{ + $BaseName = $_.BaseName + Write-Output "::group::-- Log details: ${BaseName}.log --" + Get-Content -Path "${env:GITHUB_WORKSPACE}\${BaseName}.log" + Write-Output "::endgroup::" + } + + - name: Upload Info for Debug on Fail + if: failure() + uses: actions/upload-artifact@v2 + with: + retention-days: 2 + name: errors-zephir-parser-php-zephir-parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }} + path: | + ${{ github.workspace }}/tests + ${{ github.workspace }}/parser + ${{ github.workspace }}/Release* + ${{ github.workspace }}/**/Release* + pecl: name: Build PECL package runs-on: ubuntu-20.04 @@ -219,7 +243,7 @@ jobs: mkdir -p ./build-artifacts/release find ./build-artifacts -type f -name zephir-parser*.zip -exec cp {} ./build-artifacts/release/ ";" echo "-- Creating Release Notes" - GITHUB_ACTIONS=false ./.ci/release-notes.sh ./CHANGELOG.md > ./build-artifacts/release/release-notes.md + ./.ci/release-notes.sh ./CHANGELOG.md > ./build-artifacts/release/release-notes.md - name: Create Release uses: ncipollo/release-action@v1 From 144240491f5e580f6a6d5f9aeefffbf02c73346c Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Dec 2021 21:46:03 +0200 Subject: [PATCH 36/39] Enable code coverage --- .github/actions/build-linux/action.yml | 10 +++- .github/actions/build-mac/action.yml | 10 +++- .github/workflows/ci.yml | 66 ++++++++++++++++---------- 3 files changed, 58 insertions(+), 28 deletions(-) diff --git a/.github/actions/build-linux/action.yml b/.github/actions/build-linux/action.yml index 93db846c..5821adb7 100644 --- a/.github/actions/build-linux/action.yml +++ b/.github/actions/build-linux/action.yml @@ -7,7 +7,7 @@ runs: - name: Install RE2C Lexer Generator shell: bash run: | - sudo apt-get install re2c + sudo apt-get install re2c lcov - name: Build Zephir Parser for Linux shell: bash @@ -20,13 +20,19 @@ runs: echo "::group::Run configure" ./configure \ --enable-zephir-parser \ - --enable-zephir-parser-debug + --enable-zephir-parser-debug \ + ${{ env.CONFIGURE_COVERAGE }} echo "::endgroup::" echo "::group::Compile" make -j$(getconf _NPROCESSORS_ONLN) echo "::endgroup::" + - name: Preparing to collect coverage data + if: matrix.ccov == 'ON' + shell: bash + run: make coverage-initial + - name: Enable Zephir Parser shell: bash run: | diff --git a/.github/actions/build-mac/action.yml b/.github/actions/build-mac/action.yml index 176c5f15..b58d85fc 100644 --- a/.github/actions/build-mac/action.yml +++ b/.github/actions/build-mac/action.yml @@ -7,7 +7,7 @@ runs: - name: Install RE2C Lexer Generator shell: bash run: | - brew install re2c + brew install re2c lcov env: HOMEBREW_NO_INSTALL_CLEANUP: 1 @@ -22,13 +22,19 @@ runs: echo "::group::Run configure" ./configure \ --enable-zephir-parser \ - --enable-zephir-parser-debug + --enable-zephir-parser-debug \ + ${{ env.CONFIGURE_COVERAGE }} echo "::endgroup::" echo "::group::Compile" make -j$(getconf _NPROCESSORS_ONLN) echo "::endgroup::" + - name: Preparing to collect coverage data + if: matrix.ccov == 'ON' + shell: bash + run: make coverage-initial + - name: Enable Zephir Parser shell: bash run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d94260d7..c712e421 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,7 @@ on: env: RE2C_VERSION: 2.2 - PHP_SDK_VERSION: 2.2.0 - PHP_DEVPACK: C:\tools\php-devpack - PHP_SDK_PATH: C:\tools\php-sdk + CONFIGURE_COVERAGE: '' # Configure options for overage is empty by default jobs: builds: @@ -42,17 +40,17 @@ jobs: # {php}-{ts}-{os.name}-{compiler}-{arch} include: # Linux - - { name: ubuntu-gcc, os: ubuntu-18.04, compiler: gcc } + - { name: ubuntu-gcc, os: ubuntu-18.04, compiler: gcc, ccov: 'ON' } # macOS - - { name: macos-clang, os: macos-10.15, compiler: clang } + - { name: macos-clang, os: macos-10.15, compiler: clang, ccov: 'ON' } # Windows - - { php: '7.0', ts: 'nts', arch: 'x64', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14' } - - { php: '7.1', ts: 'nts', arch: 'x64', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14' } - - { php: '7.2', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } - - { php: '7.3', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } - - { php: '7.4', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } - - { php: '8.0', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } - - { php: '8.1', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } + - { php: '7.0', ts: 'nts', arch: 'x64', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14', ccov: 'OFF' } + - { php: '7.1', ts: 'nts', arch: 'x64', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14', ccov: 'OFF' } + - { php: '7.2', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15', ccov: 'OFF' } + - { php: '7.3', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15', ccov: 'OFF' } + - { php: '7.4', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15', ccov: 'OFF' } + - { php: '8.0', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16', ccov: 'OFF' } + - { php: '8.1', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16', ccov: 'OFF' } steps: - uses: actions/checkout@v2 @@ -65,6 +63,23 @@ jobs: env: PHPTS: ${{ matrix.ts }} + - name: Setup Build System + shell: bash + run: | + echo "::group::Enable Code Coverage Capture" + if [ "${{ matrix.ccov }}" = "ON" ]; then + echo "CONFIGURE_COVERAGE=--enable-coverage" >> $GITHUB_ENV + fi + echo "::endgroup::" + + echo "::group::Setup PHP executable for tests" + if [ "${{ runner.os }}" = "Windows" ]; then + echo "TEST_PHP_EXECUTABLE=C:\tools\php\php.exe" >> $GITHUB_ENV + else + echo "TEST_PHP_EXECUTABLE=$(which php)" >> $GITHUB_ENV + fi + echo "::endgroup::" + - name: Build Zephir Parser Extension (Linux) uses: ./.github/actions/build-linux if: runner.os == 'Linux' @@ -85,15 +100,6 @@ jobs: CACHE_DIR: 'C:\Downloads' TOOLS_DIR: 'C:\tools' - - name: Setup Tests - shell: bash - run: | - if [ "${{ runner.os }}" = "Windows" ]; then - echo "TEST_PHP_EXECUTABLE=C:\tools\php\php.exe" >> $GITHUB_ENV - else - echo "TEST_PHP_EXECUTABLE=$(which php)" >> $GITHUB_ENV - fi - - name: Run Tests for Zephir Parser shell: bash run: | @@ -113,14 +119,14 @@ jobs: EXTENSION="$(find ./modules -type f -name 'zephir_parser.so')" fi - zip -rvj zephir-parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip \ + zip -rvj zephir-parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }}.zip \ $EXTENSION VERSION LICENSE CREDITS NO_WARRANTY CHANGELOG.md echo "::endgroup::" - name: Upload Zephir Parser uses: actions/upload-artifact@v2 with: - name: zephir-parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip + name: zephir-parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }}.zip path: | ${{ github.workspace }}/zephir-parser-*.zip @@ -136,12 +142,24 @@ jobs: Write-Output "::endgroup::" } + - 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@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./lcov.info + flags: unittests,${{ matrix.os }} + - name: Upload Info for Debug on Fail if: failure() uses: actions/upload-artifact@v2 with: retention-days: 2 - name: errors-zephir-parser-php-zephir-parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }} + name: errors-zephir-parser-php-zephir-parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }} path: | ${{ github.workspace }}/tests ${{ github.workspace }}/parser From 2edd736d770eb10b2d63c7d89b87d37f8811ac35 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Dec 2021 22:14:24 +0200 Subject: [PATCH 37/39] Fix ccov tag, update apt list --- .gitattributes | 2 +- .github/actions/build-linux/action.yml | 1 + .github/workflows/ci.yml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index 17ba8f51..02c4a822 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ # Set the default behavior, in case people don't have core.autocrlf set. -* text=auto +* text=auto eol=lf *.c linguist-language=C *.h linguist-language=C diff --git a/.github/actions/build-linux/action.yml b/.github/actions/build-linux/action.yml index 5821adb7..b09f50cb 100644 --- a/.github/actions/build-linux/action.yml +++ b/.github/actions/build-linux/action.yml @@ -7,6 +7,7 @@ runs: - name: Install RE2C Lexer Generator shell: bash run: | + sudo apt-get update --quiet --yes 1>/dev/null sudo apt-get install re2c lcov - name: Build Zephir Parser for Linux diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c712e421..5368712d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,7 +152,7 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} files: ./lcov.info - flags: unittests,${{ matrix.os }} + flags: unittests,${{ runner.os }} - name: Upload Info for Debug on Fail if: failure() From 0938b1fb7acf5d30c56b51d921548bccbd1f4171 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Dec 2021 22:54:35 +0200 Subject: [PATCH 38/39] Fix artifact names --- .github/workflows/ci.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5368712d..7cfeb8ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,16 +119,22 @@ jobs: EXTENSION="$(find ./modules -type f -name 'zephir_parser.so')" fi - zip -rvj zephir-parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }}.zip \ + zip -rvj zephir_parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }}.zip \ $EXTENSION VERSION LICENSE CREDITS NO_WARRANTY CHANGELOG.md echo "::endgroup::" + # Artifact names should be in next format: + # zephir_parser-{php-version}-{ts}-{os.name}-{compiler}-{arch} + # example: + # zephir_parser-php-7.3-nts-macos-clang-x64.zip + # zephir_parser-php-7.3-nts-ubuntu-gcc-x64.zip + # zephir_parser-php-7.3-nts-windows2019-vc15-x64.zip - name: Upload Zephir Parser uses: actions/upload-artifact@v2 with: - name: zephir-parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }}.zip + name: zephir_parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }}.zip path: | - ${{ github.workspace }}/zephir-parser-*.zip + ${{ github.workspace }}/zephir_parser-*.zip - name: Check for Errors if: always() @@ -159,7 +165,7 @@ jobs: uses: actions/upload-artifact@v2 with: retention-days: 2 - name: errors-zephir-parser-php-zephir-parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }} + name: debug-zephir_parser-php-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }} path: | ${{ github.workspace }}/tests ${{ github.workspace }}/parser @@ -259,7 +265,7 @@ jobs: - name: Prepare Release assets run: | mkdir -p ./build-artifacts/release - find ./build-artifacts -type f -name zephir-parser*.zip -exec cp {} ./build-artifacts/release/ ";" + find ./build-artifacts -type f -name zephir_parser*.zip -exec cp {} ./build-artifacts/release/ ";" echo "-- Creating Release Notes" ./.ci/release-notes.sh ./CHANGELOG.md > ./build-artifacts/release/release-notes.md From e3be9009e693499a8c103d52fb89d45bc356391f Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 11 Dec 2021 21:12:28 +0000 Subject: [PATCH 39/39] Bump version to `1.4.2` --- CHANGELOG.md | 5 ++++- VERSION | 2 +- package.xml | 8 ++++---- zephir_parser.h | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8622b21b..8e2354d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] + +## [1.4.2] - 2021-12-11 ### Added - Enabled support of PHP8.1 for PECL [#116](https://github.com/phalcon/php-zephir-parser/issues/116) @@ -179,7 +181,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.4.1...HEAD +[Unreleased]: https://github.com/phalcon/php-zephir-parser/compare/v1.4.2...HEAD +[1.4.2]: https://github.com/phalcon/php-zephir-parser/compare/v1.4.1...v1.4.2 [1.4.1]: https://github.com/phalcon/php-zephir-parser/compare/v1.4.0...v1.4.1 [1.4.0]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.8...v1.4.0 [1.3.8]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.7...v1.3.8 diff --git a/VERSION b/VERSION index 347f5833..9df886c4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.1 +1.4.2 diff --git a/package.xml b/package.xml index 4fdd47f2..68a2cc8c 100644 --- a/package.xml +++ b/package.xml @@ -15,8 +15,8 @@ 2021-09-18 - 1.4.1 - 1.4.1 + 1.4.2 + 1.4.2 stable @@ -24,11 +24,11 @@ MIT - Sat, Sep 18, 2021 - Zephir Parser 1.4.1 + Sat, Dec 1, 2021 - Zephir Parser 1.4.2 = Changes: - - Fixed issue #125: Renamed extension name from `Zephir Parser` to `zephir_parser` + - Enabled support of PHP8.1 diff --git a/zephir_parser.h b/zephir_parser.h index 3cccd21d..675b51dc 100644 --- a/zephir_parser.h +++ b/zephir_parser.h @@ -15,7 +15,7 @@ extern zend_module_entry zephir_parser_module_entry; #define phpext_zephir_parser_ptr &zephir_parser_module_entry #define PHP_ZEPHIR_PARSER_NAME "zephir_parser" -#define PHP_ZEPHIR_PARSER_VERSION "1.4.1" +#define PHP_ZEPHIR_PARSER_VERSION "1.4.2" #define PHP_ZEPHIR_PARSER_AUTHOR "Zephir Team and contributors" #define PHP_ZEPHIR_PARSER_DESCRIPTION "The Zephir Parser delivered as a C extension for the PHP language."