From fabc7b98cf969cd8be5fe64e6dfc8eae91a3c611 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 21:19:17 +0100 Subject: [PATCH 001/164] #110 - Add Windows workflow --- .github/workflows/windows.yml | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 00000000..0541e0b4 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,40 @@ +name: Windows + +on: + push: + branches-ignore: + - 'wip-*' + paths-ignore: + - '*.md' + pull_request: + branches: + - master + - development + schedule: + - cron: '0 11 * * *' + +jobs: + ci: + strategy: + fail-fast: false + + matrix: + php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] + build-type: ['Win32', 'nts-Win32'] + vc-version: [14, 15, 16] + arch: ['x86', 'x64'] + exclude: + - php: ['7.0', '7.1'] + vc-version: [15, 16] + + - php: ['7.2', '7.3', '7.4'] + vc-version: [14, 16] + + - php: ['8.0'] + vc-version: [14, 15] + + name: "Windows ${{ matrix.build-type }} ${{ matrix.arch }} with VC${{ matrix.vc-version }} and PHP ${{ matrix.php }}" + runs-on: windows-2016 + + steps: + - run: echo "OK" From 28fc5a72a4b8db018b37766705ad8f2049c586d5 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 21:19:46 +0100 Subject: [PATCH 002/164] #110 - Add PHP 7.2 for Linux and MacOS builds --- .github/workflows/{main.yml => linux-macos.yml} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename .github/workflows/{main.yml => linux-macos.yml} (98%) diff --git a/.github/workflows/main.yml b/.github/workflows/linux-macos.yml similarity index 98% rename from .github/workflows/main.yml rename to .github/workflows/linux-macos.yml index a416d5e7..5f223ec0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/linux-macos.yml @@ -1,4 +1,4 @@ -name: build +name: Linux and MacOS on: push: @@ -25,6 +25,7 @@ jobs: php: - '7.0' - '7.1' + - '7.2' - '7.3' - '7.4' - '8.0' From e84d8a2c63f7a0997a090548af16fb4fee0bfccc Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 21:29:31 +0100 Subject: [PATCH 003/164] #110 - Update matrix in Win builds --- .github/workflows/windows.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 0541e0b4..043bc394 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -21,17 +21,16 @@ jobs: matrix: php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] build-type: ['Win32', 'nts-Win32'] - vc-version: [14, 15, 16] - arch: ['x86', 'x64'] - exclude: +# arch: ['x86', 'x64'] + include: - php: ['7.0', '7.1'] - vc-version: [15, 16] + vc-version: 14 - php: ['7.2', '7.3', '7.4'] - vc-version: [14, 16] + vc-version: 15 - php: ['8.0'] - vc-version: [14, 15] + vc-version: 16 name: "Windows ${{ matrix.build-type }} ${{ matrix.arch }} with VC${{ matrix.vc-version }} and PHP ${{ matrix.php }}" runs-on: windows-2016 From fe2b0092a4d1f30ba0cbccdf3f43c69e53698460 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 21:31:21 +0100 Subject: [PATCH 004/164] #110 - Update matrix in Win builds --- .github/workflows/windows.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 043bc394..cc2e5b07 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -24,12 +24,15 @@ jobs: # arch: ['x86', 'x64'] include: - php: ['7.0', '7.1'] + build-type: ['Win32', 'nts-Win32'] vc-version: 14 - php: ['7.2', '7.3', '7.4'] + build-type: ['Win32', 'nts-Win32'] vc-version: 15 - php: ['8.0'] + build-type: ['Win32', 'nts-Win32'] vc-version: 16 name: "Windows ${{ matrix.build-type }} ${{ matrix.arch }} with VC${{ matrix.vc-version }} and PHP ${{ matrix.php }}" From 3dc986e27da1317a84318ce1363ece5cb63ea76c Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 21:41:37 +0100 Subject: [PATCH 005/164] #110 - Update matrix in Win builds --- .github/workflows/windows.yml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index cc2e5b07..aa891837 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -20,22 +20,18 @@ jobs: matrix: php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] - build-type: ['Win32', 'nts-Win32'] -# arch: ['x86', 'x64'] - include: - - php: ['7.0', '7.1'] - build-type: ['Win32', 'nts-Win32'] - vc-version: 14 + arch: ['x86', 'x64'] + build_type: ['ts', 'nts'] + vc_num: [14, 15, 16] - - php: ['7.2', '7.3', '7.4'] - build-type: ['Win32', 'nts-Win32'] - vc-version: 15 + exclude: + - php: '7.0' + vc_num: 15 - - php: ['8.0'] - build-type: ['Win32', 'nts-Win32'] - vc-version: 16 + - php: '7.0' + vc_num: 16 - name: "Windows ${{ matrix.build-type }} ${{ matrix.arch }} with VC${{ matrix.vc-version }} and PHP ${{ matrix.php }}" + name: "Windows ${{ matrix.arch }} VC${{ matrix.vc-version }} and PHP ${{ matrix.php }}-${{ matrix.build_type }}" runs-on: windows-2016 steps: From e17430de3688c5098d2a572f9c12f48a656292c4 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 21:46:37 +0100 Subject: [PATCH 006/164] #110 - Update matrix in Win builds --- .github/workflows/windows.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index aa891837..52172fac 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -27,11 +27,35 @@ jobs: exclude: - php: '7.0' vc_num: 15 - - php: '7.0' vc_num: 16 - name: "Windows ${{ matrix.arch }} VC${{ matrix.vc-version }} and PHP ${{ matrix.php }}-${{ matrix.build_type }}" + - php: '7.1' + vc_num: 15 + - php: '7.1' + vc_num: 16 + + - php: '7.2' + vc_num: 14 + - php: '7.2' + vc_num: 16 + + - php: '7.3' + vc_num: 14 + - php: '7.3' + vc_num: 16 + + - php: '7.4' + vc_num: 14 + - php: '7.4' + vc_num: 16 + + - php: '8.0' + vc_num: 14 + - php: '8.0' + vc_num: 15 + + name: "Windows ${{ matrix.arch }} VC${{ matrix.vc_num }} and PHP ${{ matrix.php }}-${{ matrix.build_type }}" runs-on: windows-2016 steps: From 61f8e794111e6db37837a5311530c3ae4aeee469 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 22:10:11 +0100 Subject: [PATCH 007/164] #110 - Partial implementation of Windows CI --- .ci/AppVeyor.psm1 | 22 -------------- .ci/win-ci-tools.psm1 | 46 ++++++++++++++++++++++++++++ .github/workflows/windows.yml | 57 +++++++++++++++++++++++++++++++++-- 3 files changed, 100 insertions(+), 25 deletions(-) create mode 100644 .ci/win-ci-tools.psm1 diff --git a/.ci/AppVeyor.psm1 b/.ci/AppVeyor.psm1 index d4887f7b..751ecc83 100644 --- a/.ci/AppVeyor.psm1 +++ b/.ci/AppVeyor.psm1 @@ -13,28 +13,6 @@ Function InitializeBuildVars { } } -Function InitializeReleaseVars { - If ($Env:BUILD_TYPE -Match "nts-Win32") { - $Env:RELEASE_ZIPBALL = "zephir_parser_${Env:PLATFORM}_vc${Env:VC_VERSION}_php${Env:PHP_VERSION}-nts_${Env:APPVEYOR_BUILD_VERSION}" - - If ($Env:PLATFORM -eq 'x86') { - $Env:RELEASE_FOLDER = "Release" - } Else { - $Env:RELEASE_FOLDER = "x64\Release" - } - } Else { - $Env:RELEASE_ZIPBALL = "zephir_parser_${Env:PLATFORM}_vc${Env:VC_VERSION}_php${Env:PHP_VERSION}_${Env:APPVEYOR_BUILD_VERSION}" - - If ($Env:PLATFORM -eq 'x86') { - $Env:RELEASE_FOLDER = "Release_TS" - } Else { - $Env:RELEASE_FOLDER = "x64\Release_TS" - } - } - - $Env:RELEASE_PATH = "${Env:APPVEYOR_BUILD_FOLDER}\${Env:RELEASE_FOLDER}" -} - Function AppendSessionPath { [string[]] $PathsCollection = @( "${Env:VSCOMNTOOLS}\..\..\VC", diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 new file mode 100644 index 00000000..0274d348 --- /dev/null +++ b/.ci/win-ci-tools.psm1 @@ -0,0 +1,46 @@ +# 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 { + If ($Env:BUILD_TYPE -Match "nts") { + $Env:RELEASE_ZIPBALL = "zephir_parser_${Env:PHP_ARCH}_vc${Env:VC_VERSION}_php${Env:PHP_VERSION}-nts_${Env:BUILD_VERSION}" + + If ($Env:PHP_ARCH -eq 'x86') { + $Env:RELEASE_FOLDER = "Release" + } Else { + $Env:RELEASE_FOLDER = "x64\Release" + } + } Else { + $Env:RELEASE_ZIPBALL = "zephir_parser_${Env:PHP_ARCH}_vc${Env:VC_VERSION}_php${Env:PHP_VERSION}_${Env:BUILD_VERSION}" + + If ($Env:PHP_ARCH -eq 'x86') { + $Env:RELEASE_FOLDER = "Release_TS" + } Else { + $Env:RELEASE_FOLDER = "x64\Release_TS" + } + } + + $Env:RELEASE_PATH = "${Env:APPVEYOR_BUILD_FOLDER}\${Env:RELEASE_FOLDER}" +} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 52172fac..b03f3567 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -10,8 +10,8 @@ on: branches: - master - development - schedule: - - cron: '0 11 * * *' +# schedule: +# - cron: '0 11 * * *' jobs: ci: @@ -59,4 +59,55 @@ jobs: runs-on: windows-2016 steps: - - run: echo "OK" + - 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=${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 + + - 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: Getting Details About Installed PHP + run: Get-Php "${env:PHPROOT}" + + - name: Install System Dependencies + run: choco install -y --cache-location=C:\Downloads\Choco re2c + + - run: | + cmd /c .ci\build-win32.bat + phpize + configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared + nmake 2> compile-errors.log 1> compile.log + InitializeReleaseVars + + - name: Enable Zephir Parser + run: Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:RELEASE_PATH}" From f328620031bf2cce300585b30b783e16661e2e78 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 22:13:54 +0100 Subject: [PATCH 008/164] #110 - Add `InstallPhpSdk` function --- .ci/win-ci-tools.psm1 | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 0274d348..e3e14baf 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -23,7 +23,7 @@ function SetupCommonEnvironment { git config --global advice.detachedHead false } -Function InitializeReleaseVars { +function InitializeReleaseVars { If ($Env:BUILD_TYPE -Match "nts") { $Env:RELEASE_ZIPBALL = "zephir_parser_${Env:PHP_ARCH}_vc${Env:VC_VERSION}_php${Env:PHP_VERSION}-nts_${Env:BUILD_VERSION}" @@ -44,3 +44,31 @@ Function InitializeReleaseVars { $Env:RELEASE_PATH = "${Env:APPVEYOR_BUILD_FOLDER}\${Env:RELEASE_FOLDER}" } + +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 + } +} From f8d785f3758f8d1a099c97ded07873d0da06b762 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 22:16:03 +0100 Subject: [PATCH 009/164] #110 - Add PHP_* env variables --- .github/workflows/windows.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b03f3567..b8af28eb 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -13,6 +13,11 @@ on: # schedule: # - cron: '0 11 * * *' +env: + PHP_SDK_VERSION: 2.2.0 + PHP_DEVPACK: C:\tools\php-devpack + PHP_SDK_PATH: C:\tools\php-sdk + jobs: ci: strategy: From dc08f58dbe4622578f381dcc13c070484cf4bbe6 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 22:17:14 +0100 Subject: [PATCH 010/164] #110 - Temporary disable on pull_request --- .github/workflows/windows.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b8af28eb..865e1854 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -6,10 +6,12 @@ on: - 'wip-*' paths-ignore: - '*.md' - pull_request: - branches: - - master - - development + +# pull_request: +# branches: +# - master +# - development + # schedule: # - cron: '0 11 * * *' From fe13aa6ec025e24fac76451324fc4b512e27716b Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 22:18:44 +0100 Subject: [PATCH 011/164] #110 - Add `DownloadFile` function --- .ci/win-ci-tools.psm1 | 46 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index e3e14baf..b5e26816 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -72,3 +72,49 @@ function InstallPhpSdk { Move-Item -Path $DestinationUnzipPath -Destination $env:PHP_SDK_PATH } } + +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++ + } + } + } + } +} From 81f1442b28c179d03b0860daa3f8e289e5856390 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 22:19:14 +0100 Subject: [PATCH 012/164] #110 - Temporary disable linux and macos builds --- .github/workflows/{linux-macos.yml => linux-macos.yml_disable} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{linux-macos.yml => linux-macos.yml_disable} (100%) diff --git a/.github/workflows/linux-macos.yml b/.github/workflows/linux-macos.yml_disable similarity index 100% rename from .github/workflows/linux-macos.yml rename to .github/workflows/linux-macos.yml_disable From d1ad6c0386414d0585264b3917b58e53642d0787 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 22:22:06 +0100 Subject: [PATCH 013/164] #110 - Add `Expand-Item7zip` function --- .ci/win-ci-tools.psm1 | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index b5e26816..b4e7e405 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -118,3 +118,30 @@ function DownloadFile { } } } + +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 + } +} From dd684d34ccdbc40a9df7d43c1a4d9a6c3bf92701 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 22:25:26 +0100 Subject: [PATCH 014/164] #110 - Add `InstallPhpDevPack` function --- .ci/win-ci-tools.psm1 | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index b4e7e405..8c87020b 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -73,6 +73,41 @@ function InstallPhpSdk { } } +function InstallPhpDevPack { + <# + .SYNOPSIS + Intstall PHP Developer pack from sources. + #> + + Write-Output "Install PHP Dev pack: ${env:PHP_VERSION}" + + $TS = Get-ThreadSafety + + $BaseUrl = "http://windows.php.net/downloads/releases" + $DevPack = "php-devel-pack-${env:PHP_VERSION}${TS}-Win32-vc${env:VC_VERSION}-${env:PHP_ARCH}.zip" + + $RemoteUrl = "${BaseUrl}/${DevPack}" + $RemoteArchiveUrl = "${BaseUrl}/archives/${DevPack}" + $DestinationPath = "C:\Downloads\php-devel-pack-${env:PHP_VERSION}${TS}-VC${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-VC${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 DownloadFile { <# .SYNOPSIS From 18c01b27fd2792f326cb94c2d91d8b56c6bad3b3 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 22:28:34 +0100 Subject: [PATCH 015/164] #110 - Add missing functions --- .ci/win-ci-tools.psm1 | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 8c87020b..c94147df 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -108,6 +108,31 @@ function InstallPhpDevPack { } } +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 @@ -180,3 +205,16 @@ function Expand-Item7zip { 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 +} From 14a1cff40b041cc9ff8929a615f3b69073e14b3e Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 23:00:35 +0100 Subject: [PATCH 016/164] #110 - Fix build step --- .github/workflows/windows.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 865e1854..4061947e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -109,9 +109,10 @@ jobs: - name: Install System Dependencies run: choco install -y --cache-location=C:\Downloads\Choco re2c - - run: | + - uses: ilammy/msvc-dev-cmd@v1 + run: | cmd /c .ci\build-win32.bat - phpize + buildconf configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared nmake 2> compile-errors.log 1> compile.log InitializeReleaseVars From 4a76e16e312e7fe109a161ee1239171c995f020d Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 23:01:48 +0100 Subject: [PATCH 017/164] #110 - Fix syntax --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 4061947e..04d9fdeb 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -110,7 +110,7 @@ jobs: run: choco install -y --cache-location=C:\Downloads\Choco re2c - uses: ilammy/msvc-dev-cmd@v1 - run: | + - run: | cmd /c .ci\build-win32.bat buildconf configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared From 114d0ca60920a8784accb4e108cd649da321e943 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 23:11:20 +0100 Subject: [PATCH 018/164] #110 - Fix build step --- .github/workflows/windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 04d9fdeb..bca9462d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -111,8 +111,9 @@ jobs: - uses: ilammy/msvc-dev-cmd@v1 - run: | + phpsdk_setvars cmd /c .ci\build-win32.bat - buildconf + phpize configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared nmake 2> compile-errors.log 1> compile.log InitializeReleaseVars From 149d7011c367ab8e93140c3b10ffaf1d85703edc Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 23:15:58 +0100 Subject: [PATCH 019/164] #110 - Fix build step --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index bca9462d..28fbab03 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -111,7 +111,7 @@ jobs: - uses: ilammy/msvc-dev-cmd@v1 - run: | - phpsdk_setvars + cmd /c phpsdk_setvars cmd /c .ci\build-win32.bat phpize configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared From 260962a6264591bf15e9b4515b29623add5b98c1 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 23:20:47 +0100 Subject: [PATCH 020/164] #110 - Fix build step --- .github/workflows/windows.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 28fbab03..0e1195ac 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -110,12 +110,17 @@ jobs: run: choco install -y --cache-location=C:\Downloads\Choco re2c - uses: ilammy/msvc-dev-cmd@v1 - - run: | - cmd /c phpsdk_setvars - cmd /c .ci\build-win32.bat + + - name: Build Zephir Parser + shell: cmd + run: | + phpsdk_setvars + .ci\build-win32.bat phpize configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared nmake 2> compile-errors.log 1> compile.log + + - run: | InitializeReleaseVars - name: Enable Zephir Parser From e462181fc37f6e5d2807552c44bc3f18d4707f55 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 23:25:14 +0100 Subject: [PATCH 021/164] #110 - Fix build step --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 0e1195ac..a4fd4ef0 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -114,13 +114,13 @@ jobs: - name: Build Zephir Parser shell: cmd run: | - phpsdk_setvars .ci\build-win32.bat phpize configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared nmake 2> compile-errors.log 1> compile.log - run: | + Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars - name: Enable Zephir Parser From e1ba3a644d99f1847e5a59a43412a088be57ed62 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 23:27:25 +0100 Subject: [PATCH 022/164] #110 - Add output of release path --- .github/workflows/windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a4fd4ef0..a8639b24 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -122,6 +122,7 @@ jobs: - run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars + dir ${Env:RELEASE_PATH} - name: Enable Zephir Parser run: Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:RELEASE_PATH}" From 199692eef6d72a4d302a50d1d8d295a044ad4391 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 23:38:30 +0100 Subject: [PATCH 023/164] #110 - Fix RELEASE_PATH value --- .github/workflows/windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a8639b24..820bfdf3 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -118,6 +118,7 @@ jobs: phpize configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared nmake 2> compile-errors.log 1> compile.log + dir ${env:GITHUB_WORKSPACE}\parser - run: | Import-Module .\.ci\win-ci-tools.psm1 From 7c65a122d98705abcf21b22ac38f4c7687db4f8d Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 23:45:08 +0100 Subject: [PATCH 024/164] #110 - Add directory list --- .github/workflows/windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 820bfdf3..5eb53b15 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -118,7 +118,8 @@ jobs: phpize configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared nmake 2> compile-errors.log 1> compile.log - dir ${env:GITHUB_WORKSPACE}\parser + + - run: dir ${env:GITHUB_WORKSPACE}\parser - run: | Import-Module .\.ci\win-ci-tools.psm1 From e2e58ace64547274f0bb12e0b128b3ac415e2b44 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Fri, 20 Aug 2021 23:57:34 +0100 Subject: [PATCH 025/164] #110 - Separate build and compilation steps --- .ci/win-ci-tools.psm1 | 2 +- .github/workflows/windows.yml | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index c94147df..254c5a63 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -42,7 +42,7 @@ function InitializeReleaseVars { } } - $Env:RELEASE_PATH = "${Env:APPVEYOR_BUILD_FOLDER}\${Env:RELEASE_FOLDER}" + $Env:RELEASE_PATH = "${env:GITHUB_WORKSPACE}\${Env:RELEASE_FOLDER}" } function InstallPhpSdk { diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5eb53b15..d775fcc1 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -110,17 +110,39 @@ jobs: run: choco install -y --cache-location=C:\Downloads\Choco re2c - uses: ilammy/msvc-dev-cmd@v1 + - name: Compile Lemon parser + shell: cmd + run: .ci\build-win32.bat - - name: Build Zephir Parser + - name: Build Zephir Parser (phpize) shell: cmd run: | - .ci\build-win32.bat + cd parser phpize + + - name: Build Zephir Parser (configure) + shell: cmd + run: | + cd parser configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared + + - name: Build Zephir Parser (nmake) + shell: cmd + run: | + cd parser nmake 2> compile-errors.log 1> compile.log - run: dir ${env:GITHUB_WORKSPACE}\parser + - name: Check errors + run: | + if (Test-Path -Path "${env:GITHUB_WORKSPACE}\parser\compile-errors.log") { + Get-Content -Path "${env:GITHUB_WORKSPACE}\parser\compile-errors.log" + } + if (Test-Path -Path "${env:GITHUB_WORKSPACE}\parser\compile.log") { + Get-Content -Path "${env:GITHUB_WORKSPACE}\parser\compile.log" + } + - run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars From 48f82b8bc65427a70fe2827b0798b043cb8938ac Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 00:04:49 +0100 Subject: [PATCH 026/164] #110 - Add step 'Invoke PHP SDK' --- .github/workflows/windows.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d775fcc1..56647d44 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -114,11 +114,15 @@ jobs: shell: cmd run: .ci\build-win32.bat + - name: Invoke PHP SDK + shell: cmd + run: phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat + - name: Build Zephir Parser (phpize) shell: cmd run: | cd parser - phpize + buildconf - name: Build Zephir Parser (configure) shell: cmd From 165d4ce673227024e2d6255479f8b55bafdd60b9 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 00:08:24 +0100 Subject: [PATCH 027/164] #110 - Adjust step 'Invoke PHP SDK' --- .github/workflows/windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 56647d44..985c13b1 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -115,8 +115,9 @@ jobs: run: .ci\build-win32.bat - name: Invoke PHP SDK + if: always() shell: cmd - run: phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat + run: C:\tools\php-sdk\sdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat - name: Build Zephir Parser (phpize) shell: cmd From 21f0f2651ace2099288318cb0334029c64d1d5b3 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 00:15:36 +0100 Subject: [PATCH 028/164] #110 - Fix php-sdk filename --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 985c13b1..d71ab60c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -115,11 +115,11 @@ jobs: run: .ci\build-win32.bat - name: Invoke PHP SDK - if: always() shell: cmd - run: C:\tools\php-sdk\sdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat + run: call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat - name: Build Zephir Parser (phpize) + if: always() shell: cmd run: | cd parser From 0fd862a9619e19cfe7b8bc110bc1ad92c8ea7469 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 00:18:35 +0100 Subject: [PATCH 029/164] #110 - Add 'Invoke PHP SDK Variables Setter' step --- .github/workflows/windows.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d71ab60c..6805815b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -114,16 +114,20 @@ jobs: shell: cmd run: .ci\build-win32.bat - - name: Invoke PHP SDK + - name: Invoke PHP SDK Starter shell: cmd run: call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat + - name: Invoke PHP SDK Variables Setter + shell: cmd + run: call C:\tools\php-sdk\bin\phpsdk_setvars.bat + - name: Build Zephir Parser (phpize) if: always() shell: cmd run: | cd parser - buildconf + phpize - name: Build Zephir Parser (configure) shell: cmd From 655cc732dd8a080cfec5b11e4a43eae7f78746de Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 00:24:15 +0100 Subject: [PATCH 030/164] #110 - Fix VC prefix in name --- .ci/win-ci-tools.psm1 | 14 +++++++++++--- .github/workflows/windows.yml | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 254c5a63..321139fa 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -83,12 +83,20 @@ function InstallPhpDevPack { $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-vc${env:VC_VERSION}-${env:PHP_ARCH}.zip" + $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}-VC${env:VC_VERSION}-${env:PHP_ARCH}.zip" + $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)) { @@ -98,7 +106,7 @@ function InstallPhpDevPack { -Message "Downloading PHP Dev pack" } - $DestinationUnzipPath = "${env:Temp}\php-${env:PHP_VERSION}-devel-VC${env:VC_VERSION}-${env:PHP_ARCH}" + $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 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6805815b..c75b6b28 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -144,6 +144,7 @@ jobs: - run: dir ${env:GITHUB_WORKSPACE}\parser - name: Check errors + if: always() run: | if (Test-Path -Path "${env:GITHUB_WORKSPACE}\parser\compile-errors.log") { Get-Content -Path "${env:GITHUB_WORKSPACE}\parser\compile-errors.log" From 05f1162d9acb11e8225db9dc0ce9f76aa531b1ec Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 00:30:08 +0100 Subject: [PATCH 031/164] #110 - Change to `buildconf` --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c75b6b28..a18e8c37 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -127,7 +127,7 @@ jobs: shell: cmd run: | cd parser - phpize + buildconf - name: Build Zephir Parser (configure) shell: cmd From 655ab596bd17abf0e24249778aacc6d07a6c488c Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 00:43:38 +0100 Subject: [PATCH 032/164] #110 - Change to full path `phpize` --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a18e8c37..d8c407dc 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -127,7 +127,7 @@ jobs: shell: cmd run: | cd parser - buildconf + call C:\tools\php-devpack\phpize.bat - name: Build Zephir Parser (configure) shell: cmd From 93dd9cd9bce32f9de1b7714ea0a1fb713e5d33c0 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 00:49:36 +0100 Subject: [PATCH 033/164] #110 - Merge `configure` with `phpize` --- .github/workflows/windows.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d8c407dc..74b99d53 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -128,13 +128,14 @@ jobs: run: | cd parser call C:\tools\php-devpack\phpize.bat - - - name: Build Zephir Parser (configure) - shell: cmd - run: | - cd parser configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared +# - name: Build Zephir Parser (configure) +# shell: cmd +# run: | +# cd parser +# configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared + - name: Build Zephir Parser (nmake) shell: cmd run: | From 044958d20b83b139c395dca5113ea2de6bbcd6a8 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 00:53:13 +0100 Subject: [PATCH 034/164] #110 - Disable 'Invoke PHP SDK Variables Setter' step --- .github/workflows/windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 74b99d53..25095f4a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -118,9 +118,9 @@ jobs: shell: cmd run: call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat - - name: Invoke PHP SDK Variables Setter - shell: cmd - run: call C:\tools\php-sdk\bin\phpsdk_setvars.bat +# - name: Invoke PHP SDK Variables Setter +# shell: cmd +# run: call C:\tools\php-sdk\bin\phpsdk_setvars.bat - name: Build Zephir Parser (phpize) if: always() From 5f338a6ae28abf192ee3eaaadd836f068a38847c Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 09:52:47 +0100 Subject: [PATCH 035/164] #110 - Remove `cd parser` command --- .github/workflows/windows.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 25095f4a..99ecd0eb 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -126,7 +126,6 @@ jobs: if: always() shell: cmd run: | - cd parser call C:\tools\php-devpack\phpize.bat configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared @@ -139,7 +138,6 @@ jobs: - name: Build Zephir Parser (nmake) shell: cmd run: | - cd parser nmake 2> compile-errors.log 1> compile.log - run: dir ${env:GITHUB_WORKSPACE}\parser From b4667f1a857f7bc5f92528a94e1854dcf8d63283 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 09:59:12 +0100 Subject: [PATCH 036/164] #110 - Add installation of 'bison' package --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 99ecd0eb..68d2e87b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -107,7 +107,7 @@ jobs: run: Get-Php "${env:PHPROOT}" - name: Install System Dependencies - run: choco install -y --cache-location=C:\Downloads\Choco re2c + run: choco install -y --cache-location=C:\Downloads\Choco re2c winflexbison3 - uses: ilammy/msvc-dev-cmd@v1 - name: Compile Lemon parser From 72c95fd12be4fa24b737fbc87278e5cf3882b36d Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 10:09:20 +0100 Subject: [PATCH 037/164] #110 - Enable and change order of 'Invoke PHP SDK Variables Setter' step --- .github/workflows/windows.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 68d2e87b..de578fe5 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -118,22 +118,25 @@ jobs: shell: cmd run: call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat -# - name: Invoke PHP SDK Variables Setter -# shell: cmd -# run: call C:\tools\php-sdk\bin\phpsdk_setvars.bat + - name: Invoke PHP SDK Variables Setter + shell: cmd + run: call C:\tools\php-sdk\bin\phpsdk_setvars.bat + + - uses: ilammy/msvc-dev-cmd@v1 + - name: Compile Lemon parser + shell: cmd + run: .ci\build-win32.bat - name: Build Zephir Parser (phpize) if: always() shell: cmd run: | call C:\tools\php-devpack\phpize.bat - configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared -# - name: Build Zephir Parser (configure) -# shell: cmd -# run: | -# cd parser -# configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared + - name: Build Zephir Parser (configure) + shell: cmd + run: | + configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared - name: Build Zephir Parser (nmake) shell: cmd From 53e0962cb740ae0c6c7137fc5096af6610df7d2b Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 10:09:54 +0100 Subject: [PATCH 038/164] #110 - Remove installation of 're2c' from choco --- .github/workflows/windows.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index de578fe5..dbf04dfe 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -106,14 +106,6 @@ jobs: - name: Getting Details About Installed PHP run: Get-Php "${env:PHPROOT}" - - name: Install System Dependencies - run: choco install -y --cache-location=C:\Downloads\Choco re2c winflexbison3 - - - uses: ilammy/msvc-dev-cmd@v1 - - name: Compile Lemon parser - shell: cmd - run: .ci\build-win32.bat - - name: Invoke PHP SDK Starter shell: cmd run: call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat From c653f199df58a17ec14c069c845dfc2cd1193d15 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 10:16:09 +0100 Subject: [PATCH 039/164] #110 - Adapt parser parse step --- .github/workflows/windows.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index dbf04dfe..c3b44ee3 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -114,10 +114,16 @@ jobs: shell: cmd run: call C:\tools\php-sdk\bin\phpsdk_setvars.bat - - uses: ilammy/msvc-dev-cmd@v1 - - name: Compile Lemon parser + - name: Parse Zephir Parser (Lemon) shell: cmd - run: .ci\build-win32.bat + run: | + CD parser + DEL zephir.c zephir.h parser.c scanner.c + re2c -o scanner.c scanner.re + lemon -s zephir.lemon + ECHO #include ^ > parser.c + TYPE zephir.c >> parser.c + TYPE base.c >> parser.c - name: Build Zephir Parser (phpize) if: always() From aff91c29d18e2fd841d7401d1306083272869735 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 10:20:33 +0100 Subject: [PATCH 040/164] #110 - Add 'Install CL' step --- .github/workflows/windows.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c3b44ee3..d1d05cda 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -114,6 +114,9 @@ jobs: shell: cmd run: call C:\tools\php-sdk\bin\phpsdk_setvars.bat + - name: Install CL + uses: ilammy/msvc-dev-cmd@v1 + - name: Parse Zephir Parser (Lemon) shell: cmd run: | @@ -126,7 +129,6 @@ jobs: TYPE base.c >> parser.c - name: Build Zephir Parser (phpize) - if: always() shell: cmd run: | call C:\tools\php-devpack\phpize.bat From 1f0e71be770e54858e462bd8f6cc52618e679fd6 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 10:26:12 +0100 Subject: [PATCH 041/164] #110 - Update configure step --- .github/workflows/windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d1d05cda..6301e008 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -136,6 +136,7 @@ jobs: - name: Build Zephir Parser (configure) shell: cmd run: | + call C:\tools\php-sdk\bin\phpsdk_setvars.bat configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared - name: Build Zephir Parser (nmake) From 720efcc8771fc818c83c43c27a1b38fb53c03b59 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 10:33:23 +0100 Subject: [PATCH 042/164] #110 - Merge steps due env variables reset --- .github/workflows/windows.yml | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6301e008..b739488e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -106,20 +106,13 @@ jobs: - name: Getting Details About Installed PHP run: Get-Php "${env:PHPROOT}" - - name: Invoke PHP SDK Starter - shell: cmd - run: call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat - - - name: Invoke PHP SDK Variables Setter - shell: cmd - run: call C:\tools\php-sdk\bin\phpsdk_setvars.bat - - name: Install CL uses: ilammy/msvc-dev-cmd@v1 - name: Parse Zephir Parser (Lemon) shell: cmd run: | + call C:\tools\php-sdk\bin\phpsdk_setvars.bat CD parser DEL zephir.c zephir.h parser.c scanner.c re2c -o scanner.c scanner.re @@ -131,17 +124,9 @@ jobs: - name: Build Zephir Parser (phpize) shell: cmd run: | - call C:\tools\php-devpack\phpize.bat - - - name: Build Zephir Parser (configure) - shell: cmd - run: | - call C:\tools\php-sdk\bin\phpsdk_setvars.bat + call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat + phpize configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared - - - name: Build Zephir Parser (nmake) - shell: cmd - run: | nmake 2> compile-errors.log 1> compile.log - run: dir ${env:GITHUB_WORKSPACE}\parser From e395fbd61477fc35f5ddaa9e387c0fff255e00ad Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 10:35:46 +0100 Subject: [PATCH 043/164] #110 - Update build step --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b739488e..8e8fe7a4 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -124,7 +124,7 @@ jobs: - name: Build Zephir Parser (phpize) shell: cmd run: | - call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat + call C:\tools\php-sdk\bin\phpsdk_setvars.bat phpize configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared nmake 2> compile-errors.log 1> compile.log From 21263f9673cd9a48080d4507d62d8ff6a35a05e0 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 10:38:20 +0100 Subject: [PATCH 044/164] #110 - Add missing command --- .github/workflows/windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8e8fe7a4..27f2098a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -124,6 +124,7 @@ jobs: - name: Build Zephir Parser (phpize) shell: cmd run: | + call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat call C:\tools\php-sdk\bin\phpsdk_setvars.bat phpize configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared From ab8c124b779c4fd39e4156336b91744c259614b4 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 10:42:58 +0100 Subject: [PATCH 045/164] #110 - Revert phpize path --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 27f2098a..eeaef695 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -126,7 +126,7 @@ jobs: run: | call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat call C:\tools\php-sdk\bin\phpsdk_setvars.bat - phpize + call C:\tools\php-devpack\phpize.bat configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared nmake 2> compile-errors.log 1> compile.log From 47f15fa5e78c23177ae681e8b8fb35487a4d0f3b Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 10:52:26 +0100 Subject: [PATCH 046/164] #110 - Add `PrepareReleasePackage` function --- .ci/win-ci-tools.psm1 | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 321139fa..9a5c113d 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -73,6 +73,71 @@ function InstallPhpSdk { } } +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] $ConverMdToHtml = $false, + [Parameter(Mandatory=$false)] [System.String] $BasePath = '.' + ) + + $BasePath = Resolve-Path $BasePath + $ReleaseDirectory = "${Env:APPVEYOR_PROJECT_NAME}-${Env:APPVEYOR_BUILD_ID}-${Env:APPVEYOR_JOB_ID}-${Env:APPVEYOR_JOB_NUMBER}" + + PrepareReleaseNote ` + -PhpVersion $PhpVersion ` + -BuildType $BuildType ` + -Platform $Platform ` + -ReleaseFile $ReleaseFile ` + -ReleaseDirectory $ReleaseDirectory ` + -BasePath $BasePath + + $ReleaseDestination = "${BasePath}\${ReleaseDirectory}" + + $CurrentPath = Resolve-Path '.' + + if ($ConverMdToHtml) { + InstallReleaseDependencies + 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; + } + } + + Ensure7ZipIsInstalled + + 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 zippbal: `"${ZipballName}`". ${Output}" + } + + Move-Item "${ZipballName}.zip" -Destination "${BasePath}" + Set-Location "${CurrentPath}" +} + function InstallPhpDevPack { <# .SYNOPSIS From ee9bf3eee6fce143145da87519ec15da3cb802c7 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 10:58:31 +0100 Subject: [PATCH 047/164] #110 - Add 'PrepareReleasePackage' step --- .ci/win-ci-tools.psm1 | 2 +- .github/workflows/windows.yml | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 9a5c113d..ca48ef81 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -86,7 +86,7 @@ function PrepareReleasePackage { ) $BasePath = Resolve-Path $BasePath - $ReleaseDirectory = "${Env:APPVEYOR_PROJECT_NAME}-${Env:APPVEYOR_BUILD_ID}-${Env:APPVEYOR_JOB_ID}-${Env:APPVEYOR_JOB_NUMBER}" + $ReleaseDirectory = "${Env:GITHUB_ACTOR}-${Env:GITHUB_ACTION}-${Env:GITHUB_JOB}-${Env:GITHUB_RUN_NUMBER}" PrepareReleaseNote ` -PhpVersion $PhpVersion ` diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index eeaef695..91387c6b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -145,7 +145,18 @@ jobs: - run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars - dir ${Env:RELEASE_PATH} - name: Enable Zephir Parser run: Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:RELEASE_PATH}" + + - run: | + PrepareReleasePackage ` + -PhpVersion $Env:PHP_VERSION ` + -BuildType $Env:BUILD_TYPE ` + -Platform $Env:PLATFORM ` + -ConverMdToHtml $true ` + -ReleaseFiles "${Env:RELEASE_PATH}\php_zephir_parser.dll",` + "${Env:GITHUB_WORKSPACE}\LICENSE",` + "${Env:GITHUB_WORKSPACE}\CREDITS",` + "${Env:GITHUB_WORKSPACE}\VERSION",` + "${Env:GITHUB_WORKSPACE}\NO_WARRANTY" From 0bf2e8a8044589ec78bed4bf9bc4b82d8d4ed93f Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 11:04:47 +0100 Subject: [PATCH 048/164] #110 - Fix latest steps --- .github/workflows/windows.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 91387c6b..c4382316 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -130,8 +130,6 @@ jobs: configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared nmake 2> compile-errors.log 1> compile.log - - run: dir ${env:GITHUB_WORKSPACE}\parser - - name: Check errors if: always() run: | @@ -142,14 +140,15 @@ jobs: Get-Content -Path "${env:GITHUB_WORKSPACE}\parser\compile.log" } - - run: | + - name: Enable Zephir Parser + run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars - - - name: Enable Zephir Parser - run: Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:RELEASE_PATH}" + Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:RELEASE_PATH}" - run: | + Import-Module .\.ci\win-ci-tools.psm1 + InitializeReleaseVars PrepareReleasePackage ` -PhpVersion $Env:PHP_VERSION ` -BuildType $Env:BUILD_TYPE ` From a7de95edf41db80f6f74cccb086d2bf5090d9d65 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 11:14:55 +0100 Subject: [PATCH 049/164] #110 - Fix release path --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c4382316..000ddd7f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -144,7 +144,7 @@ jobs: run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars - Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:RELEASE_PATH}" + Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:GITHUB_WORKSPACE}" - run: | Import-Module .\.ci\win-ci-tools.psm1 @@ -154,7 +154,7 @@ jobs: -BuildType $Env:BUILD_TYPE ` -Platform $Env:PLATFORM ` -ConverMdToHtml $true ` - -ReleaseFiles "${Env:RELEASE_PATH}\php_zephir_parser.dll",` + -ReleaseFiles "${Env:GITHUB_WORKSPACE}\php_zephir_parser.dll",` "${Env:GITHUB_WORKSPACE}\LICENSE",` "${Env:GITHUB_WORKSPACE}\CREDITS",` "${Env:GITHUB_WORKSPACE}\VERSION",` From f22648b3ed656a8d0f90a07fb72b1427af613d4b Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 11:23:53 +0100 Subject: [PATCH 050/164] #110 - Add `AppendSessionPath` function --- .ci/AppVeyor.psm1 | 37 --------------------------------- .ci/win-ci-tools.psm1 | 39 +++++++++++++++++++++++++++++++++++ .github/workflows/windows.yml | 1 + 3 files changed, 40 insertions(+), 37 deletions(-) diff --git a/.ci/AppVeyor.psm1 b/.ci/AppVeyor.psm1 index 751ecc83..b706236d 100644 --- a/.ci/AppVeyor.psm1 +++ b/.ci/AppVeyor.psm1 @@ -13,41 +13,4 @@ Function InitializeBuildVars { } } -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}" -} diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index ca48ef81..ab511d65 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -291,3 +291,42 @@ function Get-ThreadSafety { 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}" +} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 000ddd7f..278f460b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -143,6 +143,7 @@ jobs: - name: Enable Zephir Parser run: | Import-Module .\.ci\win-ci-tools.psm1 + AppendSessionPath InitializeReleaseVars Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:GITHUB_WORKSPACE}" From f01c91696a7a9793cc2f09053e2de2a23de5dfa0 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 11:36:21 +0100 Subject: [PATCH 051/164] #110 - Update steps --- .github/workflows/windows.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 278f460b..8d20a7c4 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -140,16 +140,17 @@ jobs: Get-Content -Path "${env:GITHUB_WORKSPACE}\parser\compile.log" } - - name: Enable Zephir Parser - run: | + - run: | Import-Module .\.ci\win-ci-tools.psm1 AppendSessionPath InitializeReleaseVars + + - name: Enable Zephir Parser + run: | Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:GITHUB_WORKSPACE}" - run: | Import-Module .\.ci\win-ci-tools.psm1 - InitializeReleaseVars PrepareReleasePackage ` -PhpVersion $Env:PHP_VERSION ` -BuildType $Env:BUILD_TYPE ` From b9290365a900073e43403b033e43461a63b719a1 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 11:55:37 +0100 Subject: [PATCH 052/164] #110 - Fix path --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8d20a7c4..e0aa3a7f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -147,7 +147,7 @@ jobs: - name: Enable Zephir Parser run: | - Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:GITHUB_WORKSPACE}" + Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:PHPROOT}" - run: | Import-Module .\.ci\win-ci-tools.psm1 From 1e310592701f2bd6c0d7a800a01fb5e32e933533 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 12:20:24 +0100 Subject: [PATCH 053/164] #110 - Update `InitializeReleaseVars` function --- .ci/win-ci-tools.psm1 | 40 +++++++++++++++++++++-------------- .github/workflows/windows.yml | 13 ++++++------ 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index ab511d65..7d298827 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -24,25 +24,33 @@ function SetupCommonEnvironment { } function InitializeReleaseVars { - If ($Env:BUILD_TYPE -Match "nts") { - $Env:RELEASE_ZIPBALL = "zephir_parser_${Env:PHP_ARCH}_vc${Env:VC_VERSION}_php${Env:PHP_VERSION}-nts_${Env:BUILD_VERSION}" + <# + .SYNOPSIS + Configures Environment variables for Release build. + #> - If ($Env:PHP_ARCH -eq 'x86') { - $Env:RELEASE_FOLDER = "Release" - } Else { - $Env:RELEASE_FOLDER = "x64\Release" - } - } Else { - $Env:RELEASE_ZIPBALL = "zephir_parser_${Env:PHP_ARCH}_vc${Env:VC_VERSION}_php${Env:PHP_VERSION}_${Env:BUILD_VERSION}" + if ($env:BUILD_TYPE -Match "nts") { + $env:RELEASE_ZIPBALL = "zephir_parser_${env:PHP_ARCH}_vc${env:VC_VERSION}_php${env:PHP_MINOR}_nts" - If ($Env:PHP_ARCH -eq 'x86') { - $Env:RELEASE_FOLDER = "Release_TS" - } Else { - $Env:RELEASE_FOLDER = "x64\Release_TS" - } - } + if ($env:PHP_ARCH -eq 'x86') { + $env:RELEASE_FOLDER = "Release" + } else { + $env:RELEASE_FOLDER = "x64\Release" + } + } else { + $env:RELEASE_ZIPBALL = "zephir_parser_${env:PHP_ARCH}_vc${env:VC_VERSION}_php${env:PHP_MINOR}" + + if ($env:PHP_ARCH -eq 'x86') { + $env:RELEASE_FOLDER = "Release_TS" + } else { + $env:RELEASE_FOLDER = "x64\Release_TS" + } + } + + $env:RELEASE_DLL_PATH = "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}\${env:EXTENSION_FILE}" - $Env:RELEASE_PATH = "${env:GITHUB_WORKSPACE}\${Env:RELEASE_FOLDER}" + 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 { diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e0aa3a7f..3f94bed1 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -19,6 +19,7 @@ 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: ci: @@ -140,14 +141,12 @@ jobs: Get-Content -Path "${env:GITHUB_WORKSPACE}\parser\compile.log" } - - run: | - Import-Module .\.ci\win-ci-tools.psm1 - AppendSessionPath - InitializeReleaseVars - - name: Enable Zephir Parser run: | - Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:PHPROOT}" + Import-Module .\.ci\win-ci-tools.psm1 + InitializeReleaseVars + Copy-Item "${env:RELEASE_DLL_PATH}" "${env:PHPROOT}\ext\${env:EXTENSION_FILE}" + EnablePhpExtension -Extension 'Zephir Parser' -Path "${env:PHPROOT}" - run: | Import-Module .\.ci\win-ci-tools.psm1 @@ -156,7 +155,7 @@ jobs: -BuildType $Env:BUILD_TYPE ` -Platform $Env:PLATFORM ` -ConverMdToHtml $true ` - -ReleaseFiles "${Env:GITHUB_WORKSPACE}\php_zephir_parser.dll",` + -ReleaseFiles "${Env:GITHUB_WORKSPACE}\${env:EXTENSION_FILE}",` "${Env:GITHUB_WORKSPACE}\LICENSE",` "${Env:GITHUB_WORKSPACE}\CREDITS",` "${Env:GITHUB_WORKSPACE}\VERSION",` From fc91a2df2053df339202b1e0b159c5ed158295f9 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 12:24:46 +0100 Subject: [PATCH 054/164] #110 - Remove usage of `RELEASE_FOLDER` env --- .ci/win-ci-tools.psm1 | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 7d298827..3a64c2a2 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -31,23 +31,11 @@ function InitializeReleaseVars { if ($env:BUILD_TYPE -Match "nts") { $env:RELEASE_ZIPBALL = "zephir_parser_${env:PHP_ARCH}_vc${env:VC_VERSION}_php${env:PHP_MINOR}_nts" - - if ($env:PHP_ARCH -eq 'x86') { - $env:RELEASE_FOLDER = "Release" - } else { - $env:RELEASE_FOLDER = "x64\Release" - } } else { $env:RELEASE_ZIPBALL = "zephir_parser_${env:PHP_ARCH}_vc${env:VC_VERSION}_php${env:PHP_MINOR}" - - if ($env:PHP_ARCH -eq 'x86') { - $env:RELEASE_FOLDER = "Release_TS" - } else { - $env:RELEASE_FOLDER = "x64\Release_TS" - } } - $env:RELEASE_DLL_PATH = "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}\${env:EXTENSION_FILE}" + $env:RELEASE_DLL_PATH = "${env:GITHUB_WORKSPACE}\${env:EXTENSION_FILE}" 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 From e579aacfb80f6042cbcd37f971098cb850d2f2b8 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 12:37:30 +0100 Subject: [PATCH 055/164] #110 - Fix value of `RELEASE_DLL_PATH` env --- .ci/win-ci-tools.psm1 | 14 +++++++++++++- .github/workflows/windows.yml | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 3a64c2a2..1b4e649f 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -31,11 +31,23 @@ function InitializeReleaseVars { if ($env:BUILD_TYPE -Match "nts") { $env:RELEASE_ZIPBALL = "zephir_parser_${env:PHP_ARCH}_vc${env:VC_VERSION}_php${env:PHP_MINOR}_nts" + + if ($env:PHP_ARCH -eq 'x86') { + $env:RELEASE_FOLDER = "x64\Release" + } else { + $env:RELEASE_FOLDER = "x64\Release" + } } else { $env:RELEASE_ZIPBALL = "zephir_parser_${env:PHP_ARCH}_vc${env:VC_VERSION}_php${env:PHP_MINOR}" + + if ($env:PHP_ARCH -eq 'x86') { + $env:RELEASE_FOLDER = "x64\Release_TS" + } else { + $env:RELEASE_FOLDER = "x64\Release_TS" + } } - $env:RELEASE_DLL_PATH = "${env:GITHUB_WORKSPACE}\${env:EXTENSION_FILE}" + $env:RELEASE_DLL_PATH = "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}\${env:EXTENSION_FILE}" 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 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 3f94bed1..f09fd3dc 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -155,7 +155,7 @@ jobs: -BuildType $Env:BUILD_TYPE ` -Platform $Env:PLATFORM ` -ConverMdToHtml $true ` - -ReleaseFiles "${Env:GITHUB_WORKSPACE}\${env:EXTENSION_FILE}",` + -ReleaseFiles "${Env:RELEASE_DLL_PATH}",` "${Env:GITHUB_WORKSPACE}\LICENSE",` "${Env:GITHUB_WORKSPACE}\CREDITS",` "${Env:GITHUB_WORKSPACE}\VERSION",` From 9c5ab8b850ea6adddf0ba26e4a052387986afbe5 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 12:40:30 +0100 Subject: [PATCH 056/164] #110 - Add debug output step --- .github/workflows/windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f09fd3dc..435bcd7f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -141,6 +141,8 @@ jobs: Get-Content -Path "${env:GITHUB_WORKSPACE}\parser\compile.log" } + - run: dir ${env:RELEASE_DLL_PATH} + - name: Enable Zephir Parser run: | Import-Module .\.ci\win-ci-tools.psm1 From 500dd2350c9b0bdfa82848c30235b974cae6b301 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 12:43:21 +0100 Subject: [PATCH 057/164] #110 - Add debug output step --- .github/workflows/windows.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 435bcd7f..1263b558 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -141,7 +141,9 @@ jobs: Get-Content -Path "${env:GITHUB_WORKSPACE}\parser\compile.log" } - - run: dir ${env:RELEASE_DLL_PATH} + - run: | + Import-Module .\.ci\win-ci-tools.psm1 + dir ${env:RELEASE_DLL_PATH} - name: Enable Zephir Parser run: | From c98cb68dd2c453c183845f64c71a27381b58291a Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 12:46:12 +0100 Subject: [PATCH 058/164] #110 - Add debug output step --- .github/workflows/windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1263b558..d90d1a95 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -143,6 +143,7 @@ jobs: - run: | Import-Module .\.ci\win-ci-tools.psm1 + InitializeReleaseVars dir ${env:RELEASE_DLL_PATH} - name: Enable Zephir Parser From a06746639f4c5fc9b2a4dfc0ea41b80fc16896e0 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 12:48:27 +0100 Subject: [PATCH 059/164] #110 - Add debug output step --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d90d1a95..4e0943eb 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -144,7 +144,7 @@ jobs: - run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars - dir ${env:RELEASE_DLL_PATH} + dir "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}" - name: Enable Zephir Parser run: | From ac127642733e2b0184b21318ee6d6fc75b1a81ad Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 12:51:09 +0100 Subject: [PATCH 060/164] #110 - Add debug output step --- .github/workflows/windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 4e0943eb..29959570 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -144,7 +144,8 @@ jobs: - run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars - dir "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}" + dir "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}\parser" + dir "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}\resp" - name: Enable Zephir Parser run: | From 97d2274a0689bb2e41c9aef4af65b5b6dcf2b49e Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 12:53:26 +0100 Subject: [PATCH 061/164] #110 - Add debug output step --- .github/workflows/windows.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 29959570..913a07df 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -145,7 +145,6 @@ jobs: Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars dir "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}\parser" - dir "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}\resp" - name: Enable Zephir Parser run: | From c045998649f91897a11d7cb1ad1fbcaf2db2b8dd Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 13:04:35 +0100 Subject: [PATCH 062/164] #110 - Add debug output step --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 913a07df..490c0767 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -144,7 +144,7 @@ jobs: - run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars - dir "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}\parser" + Get-ChildItem ${env:GITHUB_WORKSPACE} -name -recurse *.dll - name: Enable Zephir Parser run: | From 510fdf6704f7630a2de2f2f8981b5e57da07ae4f Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 13:12:24 +0100 Subject: [PATCH 063/164] #110 - Update logs path --- .github/workflows/windows.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 490c0767..83394fbd 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -134,17 +134,18 @@ jobs: - name: Check errors if: always() run: | - if (Test-Path -Path "${env:GITHUB_WORKSPACE}\parser\compile-errors.log") { - Get-Content -Path "${env:GITHUB_WORKSPACE}\parser\compile-errors.log" + if (Test-Path -Path "${env:GITHUB_WORKSPACE}\compile-errors.log") { + Get-Content -Path "${env:GITHUB_WORKSPACE}\compile-errors.log" } - if (Test-Path -Path "${env:GITHUB_WORKSPACE}\parser\compile.log") { - Get-Content -Path "${env:GITHUB_WORKSPACE}\parser\compile.log" + if (Test-Path -Path "${env:GITHUB_WORKSPACE}\compile.log") { + Get-Content -Path "${env:GITHUB_WORKSPACE}\compile.log" } - run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars Get-ChildItem ${env:GITHUB_WORKSPACE} -name -recurse *.dll + Get-ChildItem C:\ -name -recurse *.dll - name: Enable Zephir Parser run: | From ab8886efb31a7c812d1a51a52f6128c96689f2be Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 13:16:41 +0100 Subject: [PATCH 064/164] #110 - Add debug output step --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 83394fbd..112ce266 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -144,8 +144,8 @@ jobs: - run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars - Get-ChildItem ${env:GITHUB_WORKSPACE} -name -recurse *.dll - Get-ChildItem C:\ -name -recurse *.dll + Get-ChildItem D:\ -name -recurse php_zephir_parser.dll + Get-ChildItem C:\ -name -recurse php_zephir_parser.dll - name: Enable Zephir Parser run: | From 71aed03fb08e3daae12101220ac3230217e23190 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 14:16:55 +0100 Subject: [PATCH 065/164] #110 - Update `configure` flags --- .github/workflows/windows.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 112ce266..8e1a31a1 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -128,7 +128,7 @@ jobs: call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat call C:\tools\php-sdk\bin\phpsdk_setvars.bat call C:\tools\php-devpack\phpize.bat - configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared + configure --with-prefix=C:\php --with-php-build=C:\php-devpack nmake 2> compile-errors.log 1> compile.log - name: Check errors @@ -144,8 +144,7 @@ jobs: - run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars - Get-ChildItem D:\ -name -recurse php_zephir_parser.dll - Get-ChildItem C:\ -name -recurse php_zephir_parser.dll + Get-ChildItem ${Env:GITHUB_WORKSPACE} -name -recurse php_zephir_parser.dll - name: Enable Zephir Parser run: | From f129298ae61ab9933f9174ce16c517de4d19ad8f Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 14:20:34 +0100 Subject: [PATCH 066/164] #110 - Update `configure` flags --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8e1a31a1..4d32e175 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -128,8 +128,8 @@ jobs: call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat call C:\tools\php-sdk\bin\phpsdk_setvars.bat call C:\tools\php-devpack\phpize.bat - configure --with-prefix=C:\php --with-php-build=C:\php-devpack - nmake 2> compile-errors.log 1> compile.log + configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared + nmake - name: Check errors if: always() From 06c8c2d1433144422be7c134a8a34741b1ec0d24 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 14:27:50 +0100 Subject: [PATCH 067/164] #110 - Separate build steps --- .github/workflows/windows.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 4d32e175..ae587072 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -128,9 +128,21 @@ jobs: call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat call C:\tools\php-sdk\bin\phpsdk_setvars.bat call C:\tools\php-devpack\phpize.bat + + - shell: cmd + run: | + call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat + call C:\tools\php-sdk\bin\phpsdk_setvars.bat configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared + + - shell: cmd + run: | + call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat + call C:\tools\php-sdk\bin\phpsdk_setvars.bat nmake + - run: dir ${env:PHPROOT}\ext + - name: Check errors if: always() run: | From b286f5d6b488bd4b7f84fb3624650bb31174e991 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 15:43:57 +0100 Subject: [PATCH 068/164] #110 - Remove `--enable-zephir-parser=shared` option --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ae587072..f111e76f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -133,7 +133,7 @@ jobs: run: | call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat call C:\tools\php-sdk\bin\phpsdk_setvars.bat - configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared + configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all - shell: cmd run: | From 68e577dd8cf7d9264127b727ec4e48789aa0dc92 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 15:51:16 +0100 Subject: [PATCH 069/164] #110 - Remove all options --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f111e76f..188b3d55 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -133,7 +133,7 @@ jobs: run: | call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat call C:\tools\php-sdk\bin\phpsdk_setvars.bat - configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all + configure - shell: cmd run: | From 3aa5393287f1c8c15d2a5b8f96d7f7f3c79c0918 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 16:28:49 +0100 Subject: [PATCH 070/164] #110 - Change to `static` --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 188b3d55..705ca32d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -133,7 +133,7 @@ jobs: run: | call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat call C:\tools\php-sdk\bin\phpsdk_setvars.bat - configure + configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=static - shell: cmd run: | From 4fa27cf600a7a1a5b54b2e33f0fa436e414b051e Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 21 Aug 2021 16:29:33 +0100 Subject: [PATCH 071/164] #110 - Update dir step --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 705ca32d..d8dd5876 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -141,7 +141,7 @@ jobs: call C:\tools\php-sdk\bin\phpsdk_setvars.bat nmake - - run: dir ${env:PHPROOT}\ext + - run: dir "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}" - name: Check errors if: always() From 30768560da078157566c96e69f5ba5d9ee716649 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sun, 22 Aug 2021 22:48:56 +0100 Subject: [PATCH 072/164] #110 - Add Windows dockerfile --- docker/windows/Dockerfile | 77 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 docker/windows/Dockerfile diff --git a/docker/windows/Dockerfile b/docker/windows/Dockerfile new file mode 100644 index 00000000..cbec6e2d --- /dev/null +++ b/docker/windows/Dockerfile @@ -0,0 +1,77 @@ +FROM mcr.microsoft.com/windows/servercore:ltsc2019 + +COPY . C:/php-zephir-parser + +# Download required functions for git installation +RUN powershell.exe -Command \ + ((new-object net.webclient).DownloadFile('https://raw.githubusercontent.com/actions/virtual-environments/5690645f0e91c30d888353d7b58432dc0466eca9/images/win/scripts/ImageHelpers/ChocoHelpers.ps1', 'C:\ChocoHelpers.ps1')); \ + ((new-object net.webclient).DownloadFile('https://raw.githubusercontent.com/actions/virtual-environments/f93413492e47983bafbc29ab84cb697aeeb41f7b/images/win/scripts/ImageHelpers/InstallHelpers.ps1', 'C:\InstallHelpers.ps1')); \ + ((new-object net.webclient).DownloadFile('https://raw.githubusercontent.com/actions/virtual-environments/b7f276c003aea42575b52247bdb2183e355fca2f/images/win/scripts/ImageHelpers/PathHelpers.ps1', 'C:\PathHelpers.ps1')); + +# Install Choco and Git +RUN powershell.exe -Command \ + Import-Module C:\ChocoHelpers.ps1; \ + Import-Module C:\InstallHelpers.ps1; \ + Import-Module C:\PathHelpers.ps1; \ + Invoke-Expression ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/actions/virtual-environments/main/images/win/scripts/Installers/Install-Choco.ps1')); \ + Invoke-Expression ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/actions/virtual-environments/main/images/win/scripts/Installers/Install-Git.ps1')); + +# Clone 'virtual-environments' +RUN powershell.exe git clone https://github.com/actions/virtual-environments.git + +# Install all necessary dependecies +RUN powershell.exe -Command \ + Import-Module C:\virtual-environments\images\win\scripts\ImageHelpers\PathHelpers.ps1; \ + Import-Module C:\virtual-environments\images\win\scripts\ImageHelpers\InstallHelpers.ps1; \ + Import-Module C:\virtual-environments\images\win\scripts\ImageHelpers\ChocoHelpers.ps1; \ + Import-Module C:\virtual-environments\images\win\scripts\ImageHelpers\VisualStudioHelpers.ps1; \ + Invoke-Expression C:\virtual-environments\images\win\scripts\Installers\Install-VCRedist.ps1; \ + Invoke-Expression C:\virtual-environments\images\win\scripts\Installers\Install-VS.ps1; \ + Invoke-Expression C:\virtual-environments\images\win\scripts\Installers\Install-PHP.ps1; + +RUN curl -SL --output vs_buildtools.exe https://aka.ms/vs/16/release/vs_buildtools.exe && \ + (start /w vs_buildtools.exe --quiet --wait --norestart --nocache modify \ + --installPath "C:\BuildTools" \ + --add Microsoft.VisualStudio.Workload.AzureBuildTools \ + --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 \ + --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 \ + --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 \ + --remove Microsoft.VisualStudio.Component.Windows81SDK) && \ + del /q vs_buildtools.exe + +RUN dir "C:\BuildTools" + +#RUN call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\Common7\\Tools\\VsDevCmd.bat" + +ENV PHP_VERSION=8.0.9 +ENV PHP_MINOR=8.0 +ENV TEST_PHP_EXECUTABLE=C:/php/php.exe +ENV BUILD_TYPE=ts +ENV VC_VERSION=16 +ENV PHP_ARCH=x64 +ENV BUILD_VERSION=1 + +ENV PHP_SDK_VERSION=2.2.0 +ENV PHP_DEVPACK=C:/tools/php-devpack +ENV PHP_SDK_PATH=C:/tools/php-sdk +ENV EXTENSION_FILE=php_zephir_parser.dll + +# choco install visualstudio2019-workload-vctools; \ +# choco install llvm; \ +RUN powershell.exe -Command \ + choco install 7zip; \ + Import-Module C:\php-zephir-parser\.ci\win-ci-tools.psm1; \ + SetupCommonEnvironment; \ + InstallPhpSdk; \ + InstallPhpDevPack; \ + AppendSessionPath; + +RUN call C:\tools\php-sdk\bin\phpsdk_setvars.bat && \ + cd C:\php-zephir-parser\parser && \ + cl.exe lemon.c && \ + DEL zephir.c zephir.h parser.c scanner.c && \ + re2c.exe -o scanner.c scanner.re && \ + lemon.exe -s zephir.lemon && \ + ECHO #include ^ > parser.c && \ + TYPE zephir.c >> parser.c && \ + TYPE base.c >> parser.c From dc073a0dd909c1b4d061ce5ac0b1abebedf43f8e Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Mon, 23 Aug 2021 22:01:22 +0100 Subject: [PATCH 073/164] #110 - Remove AppVeyor.psm1 file --- .ci/AppVeyor.psm1 | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .ci/AppVeyor.psm1 diff --git a/.ci/AppVeyor.psm1 b/.ci/AppVeyor.psm1 deleted file mode 100644 index b706236d..00000000 --- a/.ci/AppVeyor.psm1 +++ /dev/null @@ -1,16 +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 InitializeBuildVars { - If ($Env:PLATFORM -eq 'x64') { - $Env:ARCH = 'x86_amd64' - } Else { - $Env:ARCH = 'x86' - } -} - - From 10c6487e2c062123516b449f975fa9fc912cf06a Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 29 Aug 2021 22:16:00 +0300 Subject: [PATCH 074/164] Add arch for MSVC compiler setup --- .github/workflows/windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d8dd5876..9d805474 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -109,6 +109,8 @@ jobs: - name: Install CL uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch }} - name: Parse Zephir Parser (Lemon) shell: cmd From 00bde87e7d813bb8c7c7e64334b94bfd46615ac8 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 29 Aug 2021 22:39:01 +0300 Subject: [PATCH 075/164] Add codegen arch for configure --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9d805474..6af2a18f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -135,7 +135,7 @@ jobs: run: | call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat call C:\tools\php-sdk\bin\phpsdk_setvars.bat - configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=static + configure --codegen-arch=yes --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=static - shell: cmd run: | From 1256e3d800d52988a6df33ad3dfc0c796dd44041 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 29 Aug 2021 22:44:12 +0300 Subject: [PATCH 076/164] Fix codegen arch configure options --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6af2a18f..e51e7612 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -135,7 +135,7 @@ jobs: run: | call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat call C:\tools\php-sdk\bin\phpsdk_setvars.bat - configure --codegen-arch=yes --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=static + configure --with-codegen-arch=yes --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=static - shell: cmd run: | From f39922ce12aa7e2f319d00609712c1c13a687272 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 29 Aug 2021 22:56:44 +0300 Subject: [PATCH 077/164] Set shared for module, write compiler errors to file --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e51e7612..66579746 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -135,13 +135,13 @@ jobs: run: | call C:\tools\php-sdk\phpsdk-vc${{ 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=static + configure --with-codegen-arch=yes --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared - shell: cmd run: | call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat call C:\tools\php-sdk\bin\phpsdk_setvars.bat - nmake + nmake 2> compile-errors.log 1> compile.log - run: dir "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}" From 3e390739f8b2cdc00b8d43d15f8a60bd80699424 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 29 Aug 2021 23:48:31 +0300 Subject: [PATCH 078/164] Set toolset for CL, enable fail artifacts --- .github/workflows/windows.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 66579746..d1c4fed7 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -63,7 +63,7 @@ jobs: - php: '8.0' vc_num: 15 - name: "Windows ${{ matrix.arch }} VC${{ matrix.vc_num }} and PHP ${{ matrix.php }}-${{ matrix.build_type }}" + name: "Win ${{ matrix.arch }} VC${{ matrix.vc_num }} and PHP ${{ matrix.php }}-${{ matrix.build_type }}" runs-on: windows-2016 steps: @@ -111,6 +111,7 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{ matrix.arch }} + toolset: ${{ matrix.vc_num }}.0 - name: Parse Zephir Parser (Lemon) shell: cmd @@ -141,7 +142,7 @@ jobs: run: | call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat call C:\tools\php-sdk\bin\phpsdk_setvars.bat - nmake 2> compile-errors.log 1> compile.log + nmake - run: dir "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}" @@ -179,3 +180,15 @@ jobs: "${Env:GITHUB_WORKSPACE}\CREDITS",` "${Env:GITHUB_WORKSPACE}\VERSION",` "${Env:GITHUB_WORKSPACE}\NO_WARRANTY" + + - name: Upload build artifacts after Failure + if: failure() + uses: actions/upload-artifact@v2 + with: + name: logs-${{ matrix.arch }}-vc${{ matrix.vc_num }}-php-${{ matrix.php }}-${{ matrix.build_type }} + path: | + ${{ github.workspace }}\compile-errors.log + ${{ github.workspace }}\compile.log + ${{ github.workspace }}\config.log + !${{ github.workspace }}\parser\ + retention-days: 1 From df34a29fdb047cbcc6add842adea94628504d30c Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Sep 2021 20:29:50 +0300 Subject: [PATCH 079/164] Use bat file for Lemon phase --- .github/workflows/windows.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d1c4fed7..33bc4f01 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -117,13 +117,14 @@ jobs: shell: cmd run: | call C:\tools\php-sdk\bin\phpsdk_setvars.bat - CD parser - DEL zephir.c zephir.h parser.c scanner.c - re2c -o scanner.c scanner.re - lemon -s zephir.lemon - ECHO #include ^ > parser.c - TYPE zephir.c >> parser.c - TYPE base.c >> parser.c + call .\.ci\build-win32.bat + # CD parser + # DEL zephir.c zephir.h parser.c scanner.c + # re2c -o scanner.c scanner.re + # lemon -s zephir.lemon + # ECHO #include ^ > parser.c + # TYPE zephir.c >> parser.c + # TYPE base.c >> parser.c - name: Build Zephir Parser (phpize) shell: cmd From a551f76e0bf069cdcf9ae934f773a1e0a2b869a3 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Sep 2021 20:46:51 +0300 Subject: [PATCH 080/164] Store parser for debug --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 33bc4f01..56cf6728 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -191,5 +191,5 @@ jobs: ${{ github.workspace }}\compile-errors.log ${{ github.workspace }}\compile.log ${{ github.workspace }}\config.log - !${{ github.workspace }}\parser\ + ${{ github.workspace }}\parser\ retention-days: 1 From 1d2d4d25c0154eb2c09bd3c5e68b7121907d352c Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Sep 2021 20:51:40 +0300 Subject: [PATCH 081/164] Fix echo comand for parser first string --- .ci/build-win32.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/build-win32.bat b/.ci/build-win32.bat index 34bc2110..93465138 100644 --- a/.ci/build-win32.bat +++ b/.ci/build-win32.bat @@ -14,6 +14,6 @@ cl lemon.c DEL zephir.c zephir.h parser.c scanner.c re2c -o scanner.c scanner.re lemon -s zephir.lemon -ECHO #include ^ > parser.c +ECHO "#include ^" > parser.c TYPE zephir.c >> parser.c TYPE base.c >> parser.c From 906a151db4fe067b63313a77d81a301c58509fef Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Sep 2021 21:17:42 +0300 Subject: [PATCH 082/164] Fix batch 1 --- .ci/build-win32.bat | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.ci/build-win32.bat b/.ci/build-win32.bat index 93465138..8ba43ee4 100644 --- a/.ci/build-win32.bat +++ b/.ci/build-win32.bat @@ -14,6 +14,9 @@ cl lemon.c DEL zephir.c zephir.h parser.c scanner.c re2c -o scanner.c scanner.re lemon -s zephir.lemon -ECHO "#include ^" > parser.c + +ECHO Generating parser.c + +ECHO #include ^ > parser.c TYPE zephir.c >> parser.c TYPE base.c >> parser.c From ca2bbb6888000af3e4333a9118e70810108e23a6 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Sep 2021 21:23:54 +0300 Subject: [PATCH 083/164] Fix batch 2 --- .ci/build-win32.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/build-win32.bat b/.ci/build-win32.bat index 8ba43ee4..9852e88d 100644 --- a/.ci/build-win32.bat +++ b/.ci/build-win32.bat @@ -17,6 +17,6 @@ lemon -s zephir.lemon ECHO Generating parser.c -ECHO #include ^ > parser.c +ECHO #include ^>parser.c TYPE zephir.c >> parser.c TYPE base.c >> parser.c From 5f4f0eb87fe0b8f89dd09b23dead2d39eb854a13 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Sep 2021 21:43:10 +0300 Subject: [PATCH 084/164] Fix batch 3 --- .ci/build-win32.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/build-win32.bat b/.ci/build-win32.bat index 9852e88d..896cc2f8 100644 --- a/.ci/build-win32.bat +++ b/.ci/build-win32.bat @@ -17,6 +17,6 @@ lemon -s zephir.lemon ECHO Generating parser.c -ECHO #include ^>parser.c +:: ECHO #include ^>parser.c TYPE zephir.c >> parser.c TYPE base.c >> parser.c From ecd73693239d48feea3c41f092ef2b8e402e37b3 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Sep 2021 23:26:50 +0300 Subject: [PATCH 085/164] Rewrite batch to powershell --- .ci/lemon-parser.ps1 | 38 +++++++++++++++++++++++++++++++++++ .github/workflows/windows.yml | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .ci/lemon-parser.ps1 diff --git a/.ci/lemon-parser.ps1 b/.ci/lemon-parser.ps1 new file mode 100644 index 00000000..2d05989f --- /dev/null +++ b/.ci/lemon-parser.ps1 @@ -0,0 +1,38 @@ +Write-Output "-- Compiling Lemon parser..." +$LemonSrc = Join-Path -Path './parser' -ChildPath 'lemon.c' +$LemonBin = Join-Path -Path './parser' -ChildPath 'lemon.exe' + +if ($IsWindows) { + & cl /Fe${LemonExe} ${LemonSrc} +} +else { + $LemonBin = Join-Path -Path './parser' -ChildPath 'lemon' + & gcc ${LemonSrc} -o ${LemonBin} +} +& ${LemonBin} -x + +Write-Output "-- Cleanup initial file state..." + +$AutoFiles = "./parser/zephir.c", + "./parser/zephir.h", + "./parser/parser.c", + "./parser/scanner.c" + +foreach ($GeneratedFile in $AutoFiles) { + if (Test-Path -Path $GeneratedFile) { + Remove-Item $GeneratedFile + } +} + +Write-Output "-- Run re2c..." +& re2c -o (Join-Path -Path './parser' -ChildPath 'scanner.c') (Join-Path -Path './parser' -ChildPath 'scanner.re') + +Write-Output "-- Generating zephir.c file with lemon parser..." +& ${LemonBin} -s (Join-Path -Path './parser' -ChildPath 'zephir.lemon') + +Write-Output "-- Generating parser.c file..." +$ParserC = Join-Path -Path './parser' -ChildPath 'parser.c' +$ZephirC = Join-Path -Path './parser' -ChildPath 'zephir.c' +$BaseC = Join-Path -Path './parser' -ChildPath 'base.c' +Set-Content -Path ${ParserC} -Value '#include ' +Get-Content ${ParserC}, ${ZephirC}, ${BaseC} | Set-Content ${ParserC} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 56cf6728..2bff15fb 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -117,7 +117,7 @@ jobs: shell: cmd run: | call C:\tools\php-sdk\bin\phpsdk_setvars.bat - call .\.ci\build-win32.bat + powershell.exe -File .\.ci\lemon-parser.ps1 # CD parser # DEL zephir.c zephir.h parser.c scanner.c # re2c -o scanner.c scanner.re From 71c0a8076404a9b52d42241c948058ccab95b9a1 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Sep 2021 23:34:26 +0300 Subject: [PATCH 086/164] Fix file overwriting --- .ci/lemon-parser.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/lemon-parser.ps1 b/.ci/lemon-parser.ps1 index 2d05989f..ba1da690 100644 --- a/.ci/lemon-parser.ps1 +++ b/.ci/lemon-parser.ps1 @@ -35,4 +35,4 @@ $ParserC = Join-Path -Path './parser' -ChildPath 'parser.c' $ZephirC = Join-Path -Path './parser' -ChildPath 'zephir.c' $BaseC = Join-Path -Path './parser' -ChildPath 'base.c' Set-Content -Path ${ParserC} -Value '#include ' -Get-Content ${ParserC}, ${ZephirC}, ${BaseC} | Set-Content ${ParserC} +Get-Content ${ZephirC}, ${BaseC} | Add-Content ${ParserC} From b62510e59ad82857a7c62c6a0c82e1fd995812ec Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sat, 4 Sep 2021 23:46:04 +0300 Subject: [PATCH 087/164] Remove raw lemon cmd from workflow --- .ci/lemon-parser.ps1 | 7 +++++++ .github/workflows/windows.yml | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.ci/lemon-parser.ps1 b/.ci/lemon-parser.ps1 index ba1da690..b67ae099 100644 --- a/.ci/lemon-parser.ps1 +++ b/.ci/lemon-parser.ps1 @@ -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. + Write-Output "-- Compiling Lemon parser..." $LemonSrc = Join-Path -Path './parser' -ChildPath 'lemon.c' $LemonBin = Join-Path -Path './parser' -ChildPath 'lemon.exe' diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2bff15fb..90c23de1 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -118,13 +118,6 @@ jobs: run: | call C:\tools\php-sdk\bin\phpsdk_setvars.bat powershell.exe -File .\.ci\lemon-parser.ps1 - # CD parser - # DEL zephir.c zephir.h parser.c scanner.c - # re2c -o scanner.c scanner.re - # lemon -s zephir.lemon - # ECHO #include ^ > parser.c - # TYPE zephir.c >> parser.c - # TYPE base.c >> parser.c - name: Build Zephir Parser (phpize) shell: cmd From f2ee03df1e0d0eebf03b0be9ebac82eb31a49e04 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 15:45:37 +0300 Subject: [PATCH 088/164] Fix release path and artifact name --- .ci/build-win32.bat | 22 ---------------------- .ci/win-ci-tools.psm1 | 35 ++++++++++++++++++----------------- .editorconfig | 2 +- .github/workflows/windows.yml | 5 ++++- 4 files changed, 23 insertions(+), 41 deletions(-) delete mode 100644 .ci/build-win32.bat diff --git a/.ci/build-win32.bat b/.ci/build-win32.bat deleted file mode 100644 index 896cc2f8..00000000 --- a/.ci/build-win32.bat +++ /dev/null @@ -1,22 +0,0 @@ -@ECHO off - -REM This file is part of the Zephir Parser. -REM -REM (c) Zephir Team -REM -REM For the full copyright and license information, please view -REM the LICENSE file that was distributed with this source code. - -REM Rewrite this using PowerShell -CD parser - -cl lemon.c -DEL zephir.c zephir.h parser.c scanner.c -re2c -o scanner.c scanner.re -lemon -s zephir.lemon - -ECHO Generating parser.c - -:: ECHO #include ^>parser.c -TYPE zephir.c >> parser.c -TYPE base.c >> parser.c diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 1b4e649f..2d07cc12 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -29,25 +29,26 @@ function InitializeReleaseVars { Configures Environment variables for Release build. #> - if ($env:BUILD_TYPE -Match "nts") { - $env:RELEASE_ZIPBALL = "zephir_parser_${env:PHP_ARCH}_vc${env:VC_VERSION}_php${env:PHP_MINOR}_nts" - - if ($env:PHP_ARCH -eq 'x86') { - $env:RELEASE_FOLDER = "x64\Release" - } else { - $env:RELEASE_FOLDER = "x64\Release" - } - } else { - $env:RELEASE_ZIPBALL = "zephir_parser_${env:PHP_ARCH}_vc${env:VC_VERSION}_php${env:PHP_MINOR}" - - if ($env:PHP_ARCH -eq 'x86') { - $env:RELEASE_FOLDER = "x64\Release_TS" - } else { - $env:RELEASE_FOLDER = "x64\Release_TS" - } + # All extension builds should respect next logic for build artifacts + # + # release + # |---- x64 + # | |---- ts / php_zephir_parser.dll + # | |---- nts / php_zephir_parser.dll + # |---- x86 + # | |---- ts / php_zephir_parser.dll + # | |---- nts / php_zephir_parser.dll + # + # 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 = "VS" } - $env:RELEASE_DLL_PATH = "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}\${env:EXTENSION_FILE}" + $env:RELEASE_DLL_PATH = "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}\${ArchPrefix}\${ThreadSafetyPrefix}\${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_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 diff --git a/.editorconfig b/.editorconfig index b5023d03..e5cfdb0b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,7 +11,7 @@ indent_size = 4 charset = utf-8 trim_trailing_whitespace = true -[*.{yml,m4,sh,md,php,phpt,xml,json,w32}] +[*.{yml,m4,sh,md,php,phpt,xml,json,w32,ps1,psm1}] indent_style = space [*.{yml,m4,sh}] diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 90c23de1..d4ec9a5b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -63,7 +63,7 @@ jobs: - php: '8.0' vc_num: 15 - name: "Win ${{ matrix.arch }} VC${{ matrix.vc_num }} and PHP ${{ matrix.php }}-${{ matrix.build_type }}" + name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-Win32-VC${{ matrix.vc_num }}-${{ matrix.arch }}" runs-on: windows-2016 steps: @@ -94,6 +94,7 @@ jobs: Import-Module .\.ci\win-ci-tools.psm1 SetupCommonEnvironment + # TODO: Use cache for PHP SDK and build tools - name: Install PHP SDK Binary Tools run: | Import-Module .\.ci\win-ci-tools.psm1 @@ -126,12 +127,14 @@ jobs: call C:\tools\php-sdk\bin\phpsdk_setvars.bat call C:\tools\php-devpack\phpize.bat + - name: Configure - shell: cmd run: | call C:\tools\php-sdk\phpsdk-vc${{ 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-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat From c32615498a40ce2fb838fdfc321df9b3ffc63d71 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 15:48:45 +0300 Subject: [PATCH 089/164] Fix workflow steps --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d4ec9a5b..ae53de30 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -128,14 +128,14 @@ jobs: call C:\tools\php-devpack\phpize.bat - name: Configure - - shell: cmd + shell: cmd run: | call C:\tools\php-sdk\phpsdk-vc${{ 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 + shell: cmd run: | call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat call C:\tools\php-sdk\bin\phpsdk_setvars.bat From bd4983480e6252926e2713a8d8a55c921a9f223e Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 17:04:28 +0300 Subject: [PATCH 090/164] Fix path to release folder --- .ci/win-ci-tools.psm1 | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 2d07cc12..d641cff4 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -29,25 +29,32 @@ function InitializeReleaseVars { Configures Environment variables for Release build. #> - # All extension builds should respect next logic for build artifacts - # - # release - # |---- x64 - # | |---- ts / php_zephir_parser.dll - # | |---- nts / php_zephir_parser.dll - # |---- x86 - # | |---- ts / php_zephir_parser.dll - # | |---- nts / php_zephir_parser.dll - # # 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 = "VS" } - $env:RELEASE_DLL_PATH = "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}\${ArchPrefix}\${ThreadSafetyPrefix}\${env:EXTENSION_FILE}" + # 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_ZIPBALL=${env:RELEASE_ZIPBALL}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append From d72b009a6d9f66f3a4cad3ff1cbce7f5102eefde Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 17:14:51 +0300 Subject: [PATCH 091/164] Add release folder to ENV, initialize ENV vars before use it --- .ci/win-ci-tools.psm1 | 1 + .github/workflows/windows.yml | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index d641cff4..b4036f67 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -57,6 +57,7 @@ function InitializeReleaseVars { $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 } diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ae53de30..f1996351 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -141,8 +141,6 @@ jobs: call C:\tools\php-sdk\bin\phpsdk_setvars.bat nmake - - run: dir "${env:GITHUB_WORKSPACE}\${env:RELEASE_FOLDER}" - - name: Check errors if: always() run: | @@ -153,7 +151,8 @@ jobs: Get-Content -Path "${env:GITHUB_WORKSPACE}\compile.log" } - - run: | + - name: Check build artifacts + run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars Get-ChildItem ${Env:GITHUB_WORKSPACE} -name -recurse php_zephir_parser.dll From 792cd50327a7d0517d390c39ae44a7f9bc759a65 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 17:20:32 +0300 Subject: [PATCH 092/164] Fix enable php extension step --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f1996351..f8f0a802 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -162,7 +162,7 @@ jobs: Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars Copy-Item "${env:RELEASE_DLL_PATH}" "${env:PHPROOT}\ext\${env:EXTENSION_FILE}" - EnablePhpExtension -Extension 'Zephir Parser' -Path "${env:PHPROOT}" + Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:PHPROOT}" - run: | Import-Module .\.ci\win-ci-tools.psm1 From 79dedd62d820c8630f7ca05bd4b095acb5b3e7ba Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 17:36:08 +0300 Subject: [PATCH 093/164] Split copy ext and enable step --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f8f0a802..539bc652 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -155,13 +155,13 @@ jobs: run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars - Get-ChildItem ${Env:GITHUB_WORKSPACE} -name -recurse php_zephir_parser.dll + $DllPath = Get-ChildItem ${Env:GITHUB_WORKSPACE} -name -recurse ${env:EXTENSION_FILE} | % { $_.FullName } + Copy-Item "${$DllPath}" "${env:PHPROOT}\ext\${env:EXTENSION_FILE}" - name: Enable Zephir Parser run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars - Copy-Item "${env:RELEASE_DLL_PATH}" "${env:PHPROOT}\ext\${env:EXTENSION_FILE}" Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:PHPROOT}" - run: | From c664e0b5aa3a8b9bc4e79c2b0d17d6f22052c0a5 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 17:42:32 +0300 Subject: [PATCH 094/164] Fix dll path variable --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 539bc652..4a4827b0 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -155,8 +155,8 @@ jobs: run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars - $DllPath = Get-ChildItem ${Env:GITHUB_WORKSPACE} -name -recurse ${env:EXTENSION_FILE} | % { $_.FullName } - Copy-Item "${$DllPath}" "${env:PHPROOT}\ext\${env:EXTENSION_FILE}" + $DllPath = Get-ChildItem ${Env:GITHUB_WORKSPACE} -name -recurse ${env:EXTENSION_FILE} + Copy-Item "${env:GITHUB_WORKSPACE}\${$DllPath}" "${env:PHPROOT}\ext\${env:EXTENSION_FILE}" - name: Enable Zephir Parser run: | From fbbe01ed49f2500f3c52b45322e1ed9f79ac309b Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 17:52:00 +0300 Subject: [PATCH 095/164] Fix path for enable php ext --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 4a4827b0..6f298605 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -162,7 +162,7 @@ jobs: run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars - Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:PHPROOT}" + Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:PHPROOT}\ext\${env:EXTENSION_FILE}" - run: | Import-Module .\.ci\win-ci-tools.psm1 From 2e48dfa5436ba55095f229609a9a4ebae9c5c334 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 17:58:37 +0300 Subject: [PATCH 096/164] Check if extension exists --- .github/workflows/windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6f298605..2bc6a525 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -157,12 +157,13 @@ jobs: InitializeReleaseVars $DllPath = Get-ChildItem ${Env:GITHUB_WORKSPACE} -name -recurse ${env:EXTENSION_FILE} Copy-Item "${env:GITHUB_WORKSPACE}\${$DllPath}" "${env:PHPROOT}\ext\${env:EXTENSION_FILE}" + dir "${env:PHPROOT}\ext\" - name: Enable Zephir Parser run: | Import-Module .\.ci\win-ci-tools.psm1 InitializeReleaseVars - Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:PHPROOT}\ext\${env:EXTENSION_FILE}" + Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:PHPROOT}" - run: | Import-Module .\.ci\win-ci-tools.psm1 From 2c86a811f0acf194149adc2df01f793b275d21c5 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 20:44:00 +0300 Subject: [PATCH 097/164] Add release folders to debug --- .github/workflows/windows.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2bc6a525..d9e60ef9 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -188,4 +188,7 @@ jobs: ${{ github.workspace }}\compile.log ${{ github.workspace }}\config.log ${{ github.workspace }}\parser\ + ${{ github.workspace }}\Release\ + ${{ github.workspace }}\x64\ + c:\tools\php\ext\ retention-days: 1 From cb567f006929acc27dcbb9bd86cade9940c7ae16 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 20:49:14 +0300 Subject: [PATCH 098/164] Remove php ext dir from debug --- .github/workflows/windows.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d9e60ef9..89c06a7f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -190,5 +190,4 @@ jobs: ${{ github.workspace }}\parser\ ${{ github.workspace }}\Release\ ${{ github.workspace }}\x64\ - c:\tools\php\ext\ retention-days: 1 From 027f072cb3b5718e72be634b7ac9260a042723b2 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 20:56:41 +0300 Subject: [PATCH 099/164] Disable some builds to speedup debug --- .github/workflows/windows.yml | 51 ++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 89c06a7f..963e3e35 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -27,7 +27,8 @@ 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'] + php: ['7.0'] arch: ['x86', 'x64'] build_type: ['ts', 'nts'] vc_num: [14, 15, 16] @@ -38,30 +39,30 @@ jobs: - php: '7.0' vc_num: 16 - - php: '7.1' - vc_num: 15 - - php: '7.1' - vc_num: 16 - - - php: '7.2' - vc_num: 14 - - php: '7.2' - vc_num: 16 - - - php: '7.3' - vc_num: 14 - - php: '7.3' - vc_num: 16 - - - php: '7.4' - vc_num: 14 - - php: '7.4' - vc_num: 16 - - - php: '8.0' - vc_num: 14 - - php: '8.0' - vc_num: 15 + # - php: '7.1' + # vc_num: 15 + # - php: '7.1' + # vc_num: 16 + + # - php: '7.2' + # vc_num: 14 + # - php: '7.2' + # vc_num: 16 + + # - php: '7.3' + # vc_num: 14 + # - php: '7.3' + # vc_num: 16 + + # - php: '7.4' + # vc_num: 14 + # - php: '7.4' + # vc_num: 16 + + # - php: '8.0' + # vc_num: 14 + # - php: '8.0' + # vc_num: 15 name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-Win32-VC${{ matrix.vc_num }}-${{ matrix.arch }}" runs-on: windows-2016 From 08a5efbf7dfdc9a0db767153bf5e6ad4df910797 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 21:00:39 +0300 Subject: [PATCH 100/164] Add debug for extension --- .github/workflows/windows.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 963e3e35..0ee1d463 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -183,7 +183,7 @@ jobs: if: failure() uses: actions/upload-artifact@v2 with: - name: logs-${{ matrix.arch }}-vc${{ matrix.vc_num }}-php-${{ matrix.php }}-${{ matrix.build_type }} + name: logs-PHP-${{ matrix.php }}-${{ matrix.build_type }}-Win32-VC${{ matrix.vc_num }}-${{ matrix.arch }} path: | ${{ github.workspace }}\compile-errors.log ${{ github.workspace }}\compile.log @@ -192,3 +192,12 @@ jobs: ${{ github.workspace }}\Release\ ${{ github.workspace }}\x64\ retention-days: 1 + + - name: Upload PHP ext after Failure + if: failure() + uses: actions/upload-artifact@v2 + with: + name: ext-PHP-${{ matrix.php }}-${{ matrix.build_type }}-Win32-VC${{ matrix.vc_num }}-${{ matrix.arch }} + path: | + C:\tools\php\ext + retention-days: 1 From 5958b8a7c4fb8d08c088e6319cb35a2c625a2999 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 21:22:27 +0300 Subject: [PATCH 101/164] Move extension test to psm1 --- .ci/win-ci-tools.psm1 | 19 +++++++++++++++++++ .github/workflows/windows.yml | 3 +-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index b4036f67..cd2ef763 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -347,3 +347,22 @@ function AppendSessionPath { Set-Location "${CurrentPath}" } + +function EnableTestExtension { + <# + .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 "${env:RELEASE_DLL_PATH}" "${env:PHPROOT}\ext\${env:EXTENSION_FILE}" + + Enable-PhpExtension -Extension "${env:EXTENSION_NAME}" -Path "${env:PHPROOT}" +} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 0ee1d463..d9b8dd0f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -163,8 +163,7 @@ jobs: - name: Enable Zephir Parser run: | Import-Module .\.ci\win-ci-tools.psm1 - InitializeReleaseVars - Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:PHPROOT}" + EnableTestExtension - run: | Import-Module .\.ci\win-ci-tools.psm1 From 14c6896bb49a16b1dc2bf0949ae9b3180cef52c0 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 21:32:18 +0300 Subject: [PATCH 102/164] Fix extension enabler script --- .ci/win-ci-tools.psm1 | 4 ++-- .github/workflows/windows.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index cd2ef763..53be0812 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -348,7 +348,7 @@ function AppendSessionPath { Set-Location "${CurrentPath}" } -function EnableTestExtension { +function EnableExtension { <# .SYNOPSIS Enables PHP Extension. @@ -364,5 +364,5 @@ function EnableTestExtension { Copy-Item "${env:RELEASE_DLL_PATH}" "${env:PHPROOT}\ext\${env:EXTENSION_FILE}" - Enable-PhpExtension -Extension "${env:EXTENSION_NAME}" -Path "${env:PHPROOT}" + Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:PHPROOT}" } diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d9b8dd0f..1fc1f042 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -163,7 +163,7 @@ jobs: - name: Enable Zephir Parser run: | Import-Module .\.ci\win-ci-tools.psm1 - EnableTestExtension + EnableExtension - run: | Import-Module .\.ci\win-ci-tools.psm1 From a54de01113d90241e1e6c8e963bea8e11911f914 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 21:54:16 +0300 Subject: [PATCH 103/164] Run tests --- .github/workflows/windows.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1fc1f042..d629e16a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -160,6 +160,10 @@ jobs: Copy-Item "${env:GITHUB_WORKSPACE}\${$DllPath}" "${env:PHPROOT}\ext\${env:EXTENSION_FILE}" dir "${env:PHPROOT}\ext\" + - name: Run Tests + run: | + & ${env:TEST_PHP_EXECUTABLE} run-tests.php + - name: Enable Zephir Parser run: | Import-Module .\.ci\win-ci-tools.psm1 From 4b132f0baf1efae83222061805e410f9da02b13a Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 22:04:41 +0300 Subject: [PATCH 104/164] Remove not necessary steps --- .github/workflows/windows.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d629e16a..871a00c9 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -152,23 +152,15 @@ jobs: Get-Content -Path "${env:GITHUB_WORKSPACE}\compile.log" } - - name: Check build artifacts + - name: Enable Zephir Parser run: | Import-Module .\.ci\win-ci-tools.psm1 - InitializeReleaseVars - $DllPath = Get-ChildItem ${Env:GITHUB_WORKSPACE} -name -recurse ${env:EXTENSION_FILE} - Copy-Item "${env:GITHUB_WORKSPACE}\${$DllPath}" "${env:PHPROOT}\ext\${env:EXTENSION_FILE}" - dir "${env:PHPROOT}\ext\" + EnableExtension - name: Run Tests run: | & ${env:TEST_PHP_EXECUTABLE} run-tests.php - - name: Enable Zephir Parser - run: | - Import-Module .\.ci\win-ci-tools.psm1 - EnableExtension - - run: | Import-Module .\.ci\win-ci-tools.psm1 PrepareReleasePackage ` From 923c31df2efde0436e5fd44696cdb9de930433fd Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 22:13:07 +0300 Subject: [PATCH 105/164] Init release vars in the beginnings --- .github/workflows/windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 871a00c9..3cbaf1b4 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -94,6 +94,7 @@ jobs: run: | Import-Module .\.ci\win-ci-tools.psm1 SetupCommonEnvironment + InitializeReleaseVars # TODO: Use cache for PHP SDK and build tools - name: Install PHP SDK Binary Tools From 2842456485c221783f3b41c6a16ea7097e3cedce Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 22:23:14 +0300 Subject: [PATCH 106/164] Change copy cmd for powershell --- .ci/win-ci-tools.psm1 | 2 +- .github/workflows/windows.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 53be0812..3d0b71ad 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -362,7 +362,7 @@ function EnableExtension { throw "Unable to locate extension path: ${env:RELEASE_DLL_PATH}" } - Copy-Item "${env:RELEASE_DLL_PATH}" "${env:PHPROOT}\ext\${env:EXTENSION_FILE}" + Copy-Item -Path "${env:RELEASE_DLL_PATH}" -Destination "${env:PHPROOT}\ext\" Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:PHPROOT}" } diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 3cbaf1b4..d4346fb2 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -160,6 +160,7 @@ jobs: - name: Run Tests run: | + & ${env:TEST_PHP_EXECUTABLE} --ri 'Zephir Parser' & ${env:TEST_PHP_EXECUTABLE} run-tests.php - run: | From 692237669689fff080cf6aafa613820bb16ab36c Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 22:33:13 +0300 Subject: [PATCH 107/164] Enable extension info step --- .github/workflows/windows.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d4346fb2..980a9358 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -153,6 +153,9 @@ jobs: Get-Content -Path "${env:GITHUB_WORKSPACE}\compile.log" } + - name: Get Zephir Parser extension info + run: Get-PhpExtension "${env:RELEASE_DLL_PATH}" + - name: Enable Zephir Parser run: | Import-Module .\.ci\win-ci-tools.psm1 From 911502c0337319b0a8bc624d8b66e53c65db864d Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 22:36:09 +0300 Subject: [PATCH 108/164] Use handle instead of ext name --- .ci/win-ci-tools.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 3d0b71ad..1ebd8624 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -364,5 +364,5 @@ function EnableExtension { Copy-Item -Path "${env:RELEASE_DLL_PATH}" -Destination "${env:PHPROOT}\ext\" - Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:PHPROOT}" + Enable-PhpExtension -Extension 'zephir_parser' -Path "${env:PHPROOT}" } From 81d0342ab310df7735ef9eb56339e4fd29aafafe Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 22:41:57 +0300 Subject: [PATCH 109/164] Try to use ext version for enabler --- .ci/win-ci-tools.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 1ebd8624..94855695 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -364,5 +364,5 @@ function EnableExtension { Copy-Item -Path "${env:RELEASE_DLL_PATH}" -Destination "${env:PHPROOT}\ext\" - Enable-PhpExtension -Extension 'zephir_parser' -Path "${env:PHPROOT}" + Enable-PhpExtension -Extension 'Zephir Parser:1.3.7' -Path "${env:PHPROOT}" } From 08337e77b4d3a7fb6cd3a7022a63e358d697bbc5 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 22:57:37 +0300 Subject: [PATCH 110/164] Try to dynamically load extension --- .github/workflows/windows.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 980a9358..a6373244 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -154,17 +154,19 @@ jobs: } - name: Get Zephir Parser extension info - run: Get-PhpExtension "${env:RELEASE_DLL_PATH}" - - - name: Enable Zephir Parser run: | - Import-Module .\.ci\win-ci-tools.psm1 - EnableExtension + Get-PhpExtension "${env:RELEASE_DLL_PATH}" + & ${env:TEST_PHP_EXECUTABLE} --ini + + # - name: Enable Zephir Parser + # run: | + # Import-Module .\.ci\win-ci-tools.psm1 + # EnableExtension - name: Run Tests run: | - & ${env:TEST_PHP_EXECUTABLE} --ri 'Zephir Parser' - & ${env:TEST_PHP_EXECUTABLE} run-tests.php + & ${env:TEST_PHP_EXECUTABLE} -d extension="${env:RELEASE_DLL_PATH}" --ri 'Zephir Parser' + & ${env:TEST_PHP_EXECUTABLE} -d extension="${env:RELEASE_DLL_PATH}" run-tests.php - run: | Import-Module .\.ci\win-ci-tools.psm1 From 90fc4249639f4238eeaff92494e2b478d5c887ce Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 23:11:45 +0300 Subject: [PATCH 111/164] Enable ext manually --- .github/workflows/windows.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a6373244..02f2d381 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -158,15 +158,14 @@ jobs: Get-PhpExtension "${env:RELEASE_DLL_PATH}" & ${env:TEST_PHP_EXECUTABLE} --ini - # - name: Enable Zephir Parser - # run: | - # Import-Module .\.ci\win-ci-tools.psm1 - # EnableExtension + - name: Enable Zephir Parser + run: | + Add-Content -Path "${env:PHPROOT}\php.ini" -Value 'extension=php_zephir_parser.dll' - name: Run Tests run: | - & ${env:TEST_PHP_EXECUTABLE} -d extension="${env:RELEASE_DLL_PATH}" --ri 'Zephir Parser' - & ${env:TEST_PHP_EXECUTABLE} -d extension="${env:RELEASE_DLL_PATH}" run-tests.php + & ${env:TEST_PHP_EXECUTABLE} --ri 'Zephir Parser' + & ${env:TEST_PHP_EXECUTABLE} run-tests.php - run: | Import-Module .\.ci\win-ci-tools.psm1 From 696a97ce38f56f446007aa1133dff0207616bd73 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 5 Sep 2021 23:16:25 +0300 Subject: [PATCH 112/164] Copy ext dll manually --- .github/workflows/windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 02f2d381..fb7455e0 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -161,6 +161,7 @@ jobs: - 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\" - name: Run Tests run: | From c7be3c4397687ecf721529533b94d941265f16f8 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 13:48:04 +0300 Subject: [PATCH 113/164] Use cache for download artifacts --- .ci/win-ci-tools.psm1 | 88 +++++++++++++++++------------------ .github/workflows/windows.yml | 7 ++- 2 files changed, 50 insertions(+), 45 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 94855695..05176226 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -90,6 +90,49 @@ function InstallPhpSdk { } } +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 PrepareReleasePackage { param ( [Parameter(Mandatory=$true)] [System.String] $PhpVersion, @@ -155,49 +198,6 @@ function PrepareReleasePackage { Set-Location "${CurrentPath}" } -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 @@ -364,5 +364,5 @@ function EnableExtension { Copy-Item -Path "${env:RELEASE_DLL_PATH}" -Destination "${env:PHPROOT}\ext\" - Enable-PhpExtension -Extension 'Zephir Parser:1.3.7' -Path "${env:PHPROOT}" + Enable-PhpExtension -Extension 'Zephir Parser' -Path "${env:PHPROOT}" } diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index fb7455e0..024b102c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -96,7 +96,12 @@ jobs: SetupCommonEnvironment InitializeReleaseVars - # TODO: Use cache for PHP SDK and build tools + - name: Cache PHP SDK Binary Tools and PHP Dev Pack + uses: actions/cache@v2 + with: + path: C:\Downloads + key: ${{ runner.os }}-Zephir_Parser-PHP-${{ matrix.php }}-${{ matrix.build_type }}-Win32-VC${{ matrix.vc_num }}-${{ matrix.arch }} + - name: Install PHP SDK Binary Tools run: | Import-Module .\.ci\win-ci-tools.psm1 From 25328da3b6e7e29bbf1de82d649973ad7f5424ad Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 13:52:03 +0300 Subject: [PATCH 114/164] Improve readability --- .github/workflows/windows.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 024b102c..040c974c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -113,9 +113,10 @@ jobs: InstallPhpDevPack - name: Getting Details About Installed PHP - run: Get-Php "${env:PHPROOT}" + run: | + Get-Php "${env:PHPROOT}" - - name: Install CL + - name: Install MSVC Compiler Tool uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{ matrix.arch }} From 25c42a34be3378cc44a4ad0b39fa59e77e10f392 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 13:52:45 +0300 Subject: [PATCH 115/164] Try to disable setup php action --- .github/workflows/windows.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 040c974c..b8af2c64 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -72,13 +72,13 @@ jobs: 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: Setup PHP + # uses: shivammathur/setup-php@v2 + # with: + # php-version: ${{ matrix.php }} + # coverage: none + # env: + # PHPTS: ${{ matrix.build_type }} - name: Set Environment Variables run: | From 2ff656232d7e61b4968462d87c60e8edc4e7bd6a Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 18:21:23 +0300 Subject: [PATCH 116/164] Refactor PHP SDK init steps --- .github/workflows/windows.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b8af2c64..c30d8048 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -72,13 +72,13 @@ jobs: 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: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + env: + PHPTS: ${{ matrix.build_type }} - name: Set Environment Variables run: | @@ -123,16 +123,18 @@ jobs: toolset: ${{ matrix.vc_num }}.0 - name: Parse Zephir Parser (Lemon) + run: | + .\.ci\lemon-parser.ps1 + + - name: Set PHP SDK Environment variables shell: cmd run: | + call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat call C:\tools\php-sdk\bin\phpsdk_setvars.bat - powershell.exe -File .\.ci\lemon-parser.ps1 - name: Build Zephir Parser (phpize) shell: cmd run: | - call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat - call C:\tools\php-sdk\bin\phpsdk_setvars.bat call C:\tools\php-devpack\phpize.bat - name: Configure From c54d174933628f897dc1169309a0a239813a4af7 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 18:41:32 +0300 Subject: [PATCH 117/164] Disable tests for x86 arch --- .github/workflows/windows.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c30d8048..d9b110a9 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -171,12 +171,15 @@ jobs: 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 - - run: | + - name: Prepare Release Package + run: | Import-Module .\.ci\win-ci-tools.psm1 PrepareReleasePackage ` -PhpVersion $Env:PHP_VERSION ` From 17694d13441655619dd712a262e35d9c2e1c9f34 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 18:54:03 +0300 Subject: [PATCH 118/164] Change parser cmd --- .ci/lemon-parser.ps1 | 18 +++++++++--------- .github/workflows/windows.yml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.ci/lemon-parser.ps1 b/.ci/lemon-parser.ps1 index b67ae099..567654c7 100644 --- a/.ci/lemon-parser.ps1 +++ b/.ci/lemon-parser.ps1 @@ -10,25 +10,25 @@ $LemonSrc = Join-Path -Path './parser' -ChildPath 'lemon.c' $LemonBin = Join-Path -Path './parser' -ChildPath 'lemon.exe' if ($IsWindows) { - & cl /Fe${LemonExe} ${LemonSrc} + & cl /Fe${LemonExe} ${LemonSrc} } else { - $LemonBin = Join-Path -Path './parser' -ChildPath 'lemon' - & gcc ${LemonSrc} -o ${LemonBin} + $LemonBin = Join-Path -Path './parser' -ChildPath 'lemon' + & gcc ${LemonSrc} -o ${LemonBin} } & ${LemonBin} -x Write-Output "-- Cleanup initial file state..." $AutoFiles = "./parser/zephir.c", - "./parser/zephir.h", - "./parser/parser.c", - "./parser/scanner.c" + "./parser/zephir.h", + "./parser/parser.c", + "./parser/scanner.c" foreach ($GeneratedFile in $AutoFiles) { - if (Test-Path -Path $GeneratedFile) { - Remove-Item $GeneratedFile - } + if (Test-Path -Path $GeneratedFile) { + Remove-Item $GeneratedFile + } } Write-Output "-- Run re2c..." diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d9b110a9..d8a3e2a1 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -124,7 +124,7 @@ jobs: - name: Parse Zephir Parser (Lemon) run: | - .\.ci\lemon-parser.ps1 + powershell.exe -File .\.ci\lemon-parser.ps1 - name: Set PHP SDK Environment variables shell: cmd From 5f57d3d9f9868bc8efcf18fe023f6d1df5e346f0 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 19:12:58 +0300 Subject: [PATCH 119/164] Change steps --- .github/workflows/windows.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d8a3e2a1..b08a23ba 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -122,16 +122,16 @@ jobs: arch: ${{ matrix.arch }} toolset: ${{ matrix.vc_num }}.0 - - name: Parse Zephir Parser (Lemon) - run: | - powershell.exe -File .\.ci\lemon-parser.ps1 - - name: Set PHP SDK Environment variables shell: cmd run: | call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat call C:\tools\php-sdk\bin\phpsdk_setvars.bat + - name: Parse Zephir Parser (Lemon) + run: | + powershell.exe -File .\.ci\lemon-parser.ps1 + - name: Build Zephir Parser (phpize) shell: cmd run: | From 28ad4a7eb075e2b3847461d2ef875fa17b7ca92b Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 19:21:30 +0300 Subject: [PATCH 120/164] Revert command for Lemon --- .github/workflows/windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b08a23ba..15e096f8 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -129,7 +129,9 @@ jobs: 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: Build Zephir Parser (phpize) From 894dae6882dd7c9e0022aa0355650a2a4c8ab599 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 21:41:12 +0300 Subject: [PATCH 121/164] Debug psm1 --- .ci/win-ci-tools.psm1 | 219 +++++++++++++++++++++--------------------- 1 file changed, 111 insertions(+), 108 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 05176226..84f692a4 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -100,13 +100,13 @@ function InstallPhpDevPack { $TS = Get-ThreadSafety - if ($env:VC_VERSION -gt 15) { - $VSPrefix = "VS" - $VSPrefixSmall = "vs" - } else { - $VSPrefix = "VC" - $VSPrefixSmall = "vc" - } + 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" @@ -133,71 +133,6 @@ function InstallPhpDevPack { } } -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] $ConverMdToHtml = $false, - [Parameter(Mandatory=$false)] [System.String] $BasePath = '.' - ) - - $BasePath = Resolve-Path $BasePath - $ReleaseDirectory = "${Env:GITHUB_ACTOR}-${Env:GITHUB_ACTION}-${Env:GITHUB_JOB}-${Env:GITHUB_RUN_NUMBER}" - - PrepareReleaseNote ` - -PhpVersion $PhpVersion ` - -BuildType $BuildType ` - -Platform $Platform ` - -ReleaseFile $ReleaseFile ` - -ReleaseDirectory $ReleaseDirectory ` - -BasePath $BasePath - - $ReleaseDestination = "${BasePath}\${ReleaseDirectory}" - - $CurrentPath = Resolve-Path '.' - - if ($ConverMdToHtml) { - InstallReleaseDependencies - 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; - } - } - - Ensure7ZipIsInstalled - - 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 zippbal: `"${ZipballName}`". ${Output}" - } - - Move-Item "${ZipballName}.zip" -Destination "${BasePath}" - Set-Location "${CurrentPath}" -} - function DownloadFileUsingAlternative { <# .SYNOPSIS @@ -310,42 +245,42 @@ function Get-ThreadSafety { } 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}" + [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 { @@ -366,3 +301,71 @@ function EnableExtension { 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] $ConverMdToHtml = $false, + [Parameter(Mandatory=$false)] [System.String] $BasePath = '.' + ) + + $BasePath = Resolve-Path $BasePath + $ReleaseDirectory = "${Env:GITHUB_ACTOR}-${Env:GITHUB_ACTION}-${Env:GITHUB_JOB}-${Env:GITHUB_RUN_NUMBER}" + + Write-Output "BasePath: ${BasePath}" + Write-Output "ReleaseDirectory: ${ReleaseDirectory}" + + PrepareReleaseNote ` + -PhpVersion $PhpVersion ` + -BuildType $BuildType ` + -Platform $Platform ` + -ReleaseFile $ReleaseFile ` + -ReleaseDirectory $ReleaseDirectory ` + -BasePath $BasePath + + $ReleaseDestination = "${BasePath}\${ReleaseDirectory}" + + $CurrentPath = Resolve-Path '.' + + if ($ConverMdToHtml) { + InstallReleaseDependencies + 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; + } + } + + Ensure7ZipIsInstalled + + 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 zippbal: `"${ZipballName}`". ${Output}" + } + + Move-Item "${ZipballName}.zip" -Destination "${BasePath}" + Set-Location "${CurrentPath}" +} From 18a623438ca45ee0507c7e906eac7dcb4f0d667f Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 22:19:20 +0300 Subject: [PATCH 122/164] Debug psm1 --- .ci/win-ci-tools.psm1 | 37 +++++++++++++++++++++++++++++++---- .github/workflows/windows.yml | 2 +- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 84f692a4..781809c3 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -310,12 +310,12 @@ function PrepareReleasePackage { [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] $ConverMdToHtml = $false, + [Parameter(Mandatory=$false)] [System.Boolean] $ConvertMd2Html = $false, [Parameter(Mandatory=$false)] [System.String] $BasePath = '.' ) $BasePath = Resolve-Path $BasePath - $ReleaseDirectory = "${Env:GITHUB_ACTOR}-${Env:GITHUB_ACTION}-${Env:GITHUB_JOB}-${Env:GITHUB_RUN_NUMBER}" + $ReleaseDirectory = "${Env:GITHUB_ACTOR}-${Env:RUNNER_OS}-${Env:GITHUB_JOB}-${Env:GITHUB_RUN_NUMBER}" Write-Output "BasePath: ${BasePath}" Write-Output "ReleaseDirectory: ${ReleaseDirectory}" @@ -332,7 +332,7 @@ function PrepareReleasePackage { $CurrentPath = Resolve-Path '.' - if ($ConverMdToHtml) { + if ($ConvertMd2Html) { InstallReleaseDependencies FormatReleaseFiles -ReleaseDirectory $ReleaseDirectory } @@ -352,7 +352,7 @@ function PrepareReleasePackage { } } - Ensure7ZipIsInstalled + # Ensure7ZipIsInstalled Set-Location "${ReleaseDestination}" $Output = (& 7z a "${ZipballName}.zip" *) @@ -369,3 +369,32 @@ function PrepareReleasePackage { Move-Item "${ZipballName}.zip" -Destination "${BasePath}" 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}" +} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 15e096f8..135a8ade 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -187,7 +187,7 @@ jobs: -PhpVersion $Env:PHP_VERSION ` -BuildType $Env:BUILD_TYPE ` -Platform $Env:PLATFORM ` - -ConverMdToHtml $true ` + -ConvertMd2Html $true ` -ReleaseFiles "${Env:RELEASE_DLL_PATH}",` "${Env:GITHUB_WORKSPACE}\LICENSE",` "${Env:GITHUB_WORKSPACE}\CREDITS",` From 6a15c544d4e59ff39de538cf105422cf803e9a72 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 22:29:04 +0300 Subject: [PATCH 123/164] Debug psm1 --- .ci/win-ci-tools.psm1 | 23 ++++++++++++++++++++--- .github/workflows/windows.yml | 4 ++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 781809c3..0bbb68cd 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -333,7 +333,6 @@ function PrepareReleasePackage { $CurrentPath = Resolve-Path '.' if ($ConvertMd2Html) { - InstallReleaseDependencies FormatReleaseFiles -ReleaseDirectory $ReleaseDirectory } @@ -352,8 +351,6 @@ function PrepareReleasePackage { } } - # Ensure7ZipIsInstalled - Set-Location "${ReleaseDestination}" $Output = (& 7z a "${ZipballName}.zip" *) $ExitCode = $LASTEXITCODE @@ -398,3 +395,23 @@ function PrepareReleaseNote { 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/workflows/windows.yml b/.github/workflows/windows.yml index 135a8ade..2880b96f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -102,6 +102,10 @@ jobs: path: C:\Downloads key: ${{ runner.os }}-Zephir_Parser-PHP-${{ matrix.php }}-${{ matrix.build_type }}-Win32-VC${{ matrix.vc_num }}-${{ matrix.arch }} + - name: Install System Dependencies + run: | + choco install -y --cache-location=C:\Downloads\Choco pandoc + - name: Install PHP SDK Binary Tools run: | Import-Module .\.ci\win-ci-tools.psm1 From fe1a416aa83dad15ff77d444b7970bf4eb4818ee Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 22:44:04 +0300 Subject: [PATCH 124/164] Store parser release assets --- .github/workflows/windows.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2880b96f..67645b04 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -212,11 +212,9 @@ jobs: ${{ github.workspace }}\x64\ retention-days: 1 - - name: Upload PHP ext after Failure - if: failure() + - name: Upload Zephir Parser uses: actions/upload-artifact@v2 with: - name: ext-PHP-${{ matrix.php }}-${{ matrix.build_type }}-Win32-VC${{ matrix.vc_num }}-${{ matrix.arch }} + name: Zephir-Parser-for-PHP-${{ matrix.php }}-${{ matrix.build_type }}-Win32-VC${{ matrix.vc_num }}-${{ matrix.arch }} path: | - C:\tools\php\ext - retention-days: 1 + ${{ github.workspace }}\${{ env:RELEASE_ZIPBALL }}.zip From 02ae5246b6cd18322eb02a6110cfe8fafc841c7c Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 22:46:56 +0300 Subject: [PATCH 125/164] Fix Env vars for workflow --- .github/workflows/windows.yml | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 67645b04..2fe1f2ae 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -83,12 +83,12 @@ jobs: - 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 "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=${GITHUB_RUN_NUMBER}" | 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: | @@ -198,23 +198,9 @@ jobs: "${Env:GITHUB_WORKSPACE}\VERSION",` "${Env:GITHUB_WORKSPACE}\NO_WARRANTY" - - name: Upload build artifacts after Failure - if: failure() - uses: actions/upload-artifact@v2 - with: - name: logs-PHP-${{ matrix.php }}-${{ matrix.build_type }}-Win32-VC${{ matrix.vc_num }}-${{ matrix.arch }} - path: | - ${{ github.workspace }}\compile-errors.log - ${{ github.workspace }}\compile.log - ${{ github.workspace }}\config.log - ${{ github.workspace }}\parser\ - ${{ github.workspace }}\Release\ - ${{ github.workspace }}\x64\ - retention-days: 1 - - name: Upload Zephir Parser uses: actions/upload-artifact@v2 with: name: Zephir-Parser-for-PHP-${{ matrix.php }}-${{ matrix.build_type }}-Win32-VC${{ matrix.vc_num }}-${{ matrix.arch }} path: | - ${{ github.workspace }}\${{ env:RELEASE_ZIPBALL }}.zip + ${{ github.workspace }}\${Env:RELEASE_ZIPBALL}.zip From 344cda31c0fab42170a1843a703dcc259cc9d9ea Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 23:00:40 +0300 Subject: [PATCH 126/164] Fix zip file name --- .ci/win-ci-tools.psm1 | 4 ++-- .github/workflows/windows.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 0bbb68cd..53f1b35e 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -317,7 +317,6 @@ function PrepareReleasePackage { $BasePath = Resolve-Path $BasePath $ReleaseDirectory = "${Env:GITHUB_ACTOR}-${Env:RUNNER_OS}-${Env:GITHUB_JOB}-${Env:GITHUB_RUN_NUMBER}" - Write-Output "BasePath: ${BasePath}" Write-Output "ReleaseDirectory: ${ReleaseDirectory}" PrepareReleaseNote ` @@ -360,10 +359,11 @@ function PrepareReleasePackage { if ($ExitCode -ne 0) { Set-Location "${CurrentPath}" - throw "An error occurred while creating release zippbal: `"${ZipballName}`". ${Output}" + 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}" } diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2fe1f2ae..2d1f171c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -203,4 +203,4 @@ jobs: with: name: Zephir-Parser-for-PHP-${{ matrix.php }}-${{ matrix.build_type }}-Win32-VC${{ matrix.vc_num }}-${{ matrix.arch }} path: | - ${{ github.workspace }}\${Env:RELEASE_ZIPBALL}.zip + ${{ github.workspace }}\zephir-parser-*.zip From ac19695292f053de344f7469ba803d29672783c7 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 23:11:14 +0300 Subject: [PATCH 127/164] Disable progress for Choco, fix commit hash --- .ci/win-ci-tools.psm1 | 2 +- .github/workflows/windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index 53f1b35e..afdce288 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -390,7 +390,7 @@ function PrepareReleaseNote { 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 "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}" diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2d1f171c..7a713179 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -104,7 +104,7 @@ jobs: - name: Install System Dependencies run: | - choco install -y --cache-location=C:\Downloads\Choco pandoc + choco install -y --no-progress --cache-location=C:\Downloads\Choco pandoc - name: Install PHP SDK Binary Tools run: | From 114ab9273ae8c4a06921abe984011a23fa06b1d0 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 23:32:41 +0300 Subject: [PATCH 128/164] Enamble full matrix builds --- .github/workflows/windows.yml | 66 +++++++++++++++++------------------ 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7a713179..6f9233ff 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -27,45 +27,43 @@ jobs: fail-fast: false matrix: - # php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] - php: ['7.0'] + php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] arch: ['x86', 'x64'] build_type: ['ts', 'nts'] - vc_num: [14, 15, 16] - exclude: + include: - php: '7.0' - vc_num: 15 - - php: '7.0' - vc_num: 16 + vc_num: 14 + vc_prefix: 'vc' + os: windows-2016 - # - php: '7.1' - # vc_num: 15 - # - php: '7.1' - # vc_num: 16 + - php: '7.1' + vc_num: 14 + vc_prefix: 'vc' + os: windows-2016 - # - php: '7.2' - # vc_num: 14 - # - php: '7.2' - # vc_num: 16 + - php: '7.2' + vc_num: 15 + vc_prefix: 'vc' + os: windows-2016 - # - php: '7.3' - # vc_num: 14 - # - php: '7.3' - # vc_num: 16 + - php: '7.3' + vc_num: 15 + vc_prefix: 'vc' + os: windows-2016 - # - php: '7.4' - # vc_num: 14 - # - php: '7.4' - # vc_num: 16 + - php: '7.4' + vc_num: 15 + vc_prefix: 'vc' + os: windows-2016 - # - php: '8.0' - # vc_num: 14 - # - php: '8.0' - # vc_num: 15 + - php: '8.0' + vc_num: 16 + vc_prefix: 'vs' + os: windows-2019 - name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-Win32-VC${{ matrix.vc_num }}-${{ matrix.arch }}" - runs-on: windows-2016 + 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 @@ -100,7 +98,7 @@ jobs: uses: actions/cache@v2 with: path: C:\Downloads - key: ${{ runner.os }}-Zephir_Parser-PHP-${{ matrix.php }}-${{ matrix.build_type }}-Win32-VC${{ matrix.vc_num }}-${{ matrix.arch }} + 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: | @@ -129,7 +127,7 @@ jobs: - name: Set PHP SDK Environment variables shell: cmd run: | - call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat + 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) @@ -146,14 +144,14 @@ jobs: - name: Configure shell: cmd run: | - call C:\tools\php-sdk\phpsdk-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat + 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-vc${{ matrix.vc_num }}-${{ matrix.arch }}.bat + 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 @@ -201,6 +199,6 @@ jobs: - name: Upload Zephir Parser uses: actions/upload-artifact@v2 with: - name: Zephir-Parser-for-PHP-${{ matrix.php }}-${{ matrix.build_type }}-Win32-VC${{ matrix.vc_num }}-${{ matrix.arch }} + name: Zephir-Parser-php-${{ matrix.php }}-${{ matrix.build_type }}-Win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }} path: | ${{ github.workspace }}\zephir-parser-*.zip From cfe895944ee0883b004e535a2d3692a3da7468fe Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 23:44:47 +0300 Subject: [PATCH 129/164] Setup latest MSVC compiler version --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6f9233ff..30354181 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -122,7 +122,7 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{ matrix.arch }} - toolset: ${{ matrix.vc_num }}.0 + toolset: ${{ matrix.vc_num }}.XX - name: Set PHP SDK Environment variables shell: cmd From 84c51f0031669410a07d85cfd91d7f432a1a79f4 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Mon, 6 Sep 2021 23:49:00 +0300 Subject: [PATCH 130/164] Remove minor ver from toolset --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 30354181..f2c7e7ec 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -122,7 +122,7 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{ matrix.arch }} - toolset: ${{ matrix.vc_num }}.XX + toolset: ${{ matrix.vc_num }} - name: Set PHP SDK Environment variables shell: cmd From b61afc7e5f3b168d8874c53c01db9b1c1bff3540 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 09:42:50 +0300 Subject: [PATCH 131/164] Add tests to debug artifacts --- .github/workflows/windows.yml | 52 +++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f2c7e7ec..5962248e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -86,7 +86,7 @@ jobs: 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 + Write-Output "BUILD_VERSION=${env:GITHUB_RUN_NUMBER}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Setup Common Environmet run: | @@ -94,7 +94,7 @@ jobs: SetupCommonEnvironment InitializeReleaseVars - - name: Cache PHP SDK Binary Tools and PHP Dev Pack + - name: Cache Downloads uses: actions/cache@v2 with: path: C:\Downloads @@ -114,10 +114,6 @@ jobs: Import-Module .\.ci\win-ci-tools.psm1 InstallPhpDevPack - - name: Getting Details About Installed PHP - run: | - Get-Php "${env:PHPROOT}" - - name: Install MSVC Compiler Tool uses: ilammy/msvc-dev-cmd@v1 with: @@ -147,26 +143,18 @@ jobs: 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: Check errors - if: always() - run: | - if (Test-Path -Path "${env:GITHUB_WORKSPACE}\compile-errors.log") { - Get-Content -Path "${env:GITHUB_WORKSPACE}\compile-errors.log" - } - if (Test-Path -Path "${env:GITHUB_WORKSPACE}\compile.log") { - Get-Content -Path "${env:GITHUB_WORKSPACE}\compile.log" - } + # - 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 @@ -202,3 +190,25 @@ jobs: name: Zephir-Parser-php-${{ matrix.php }}-${{ matrix.build_type }}-Win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }} 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 Infor 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* From 7cee49bd77eec984942e18f22295f487e06c5269 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 10:29:35 +0300 Subject: [PATCH 132/164] Split configure and make --- .github/workflows/windows.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5962248e..fec6ce31 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -132,7 +132,7 @@ jobs: call C:\tools\php-sdk\bin\phpsdk_setvars.bat powershell.exe -File .\.ci\lemon-parser.ps1 - - name: Build Zephir Parser (phpize) + - name: Phpize shell: cmd run: | call C:\tools\php-devpack\phpize.bat @@ -143,14 +143,13 @@ jobs: 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 - nmake - # - 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: 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: | From 28782e849915c845b15125ce04d2c337aabbfa64 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 10:45:41 +0300 Subject: [PATCH 133/164] Use win2019 for vc15 --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index fec6ce31..51cc192e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -45,7 +45,7 @@ jobs: - php: '7.2' vc_num: 15 vc_prefix: 'vc' - os: windows-2016 + os: windows-2019 - php: '7.3' vc_num: 15 From cef541f4d8f5f2baee2a8887c38d4db436e8514a Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 11:10:43 +0300 Subject: [PATCH 134/164] Try alternative way for vsdev cmd --- .github/workflows/windows.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 51cc192e..253c158f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -115,10 +115,23 @@ jobs: InstallPhpDevPack - name: Install MSVC Compiler Tool - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: ${{ matrix.arch }} - toolset: ${{ matrix.vc_num }} + # uses: ilammy/msvc-dev-cmd@v1 + # with: + # arch: ${{ matrix.arch }} + # toolset: ${{ matrix.vc_num }} + shell: cmd + run: | + SET VSWHERE="C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere" + SET VSCMD_SKIP_SENDTELEMETRY=No way + + for /f "usebackq tokens=*" %%i in (`%VSWHERE% -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( + set InstallDir=%%i + ) + + if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" ( + echo "Found %InstallDir%\Common7\Tools\vsdevcmd.bat" + call "%InstallDir%\Common7\Tools\vsdevcmd.bat" %* + ) else "VC not found" - name: Set PHP SDK Environment variables shell: cmd From 00a6c396cddd3f9ca1d2016ebc6b7b70485b4abc Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 11:16:11 +0300 Subject: [PATCH 135/164] Try to not set toolset via action --- .github/workflows/windows.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 253c158f..106a79b9 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -115,23 +115,23 @@ jobs: InstallPhpDevPack - name: Install MSVC Compiler Tool - # uses: ilammy/msvc-dev-cmd@v1 - # with: - # arch: ${{ matrix.arch }} + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch }} # toolset: ${{ matrix.vc_num }} - shell: cmd - run: | - SET VSWHERE="C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere" - SET VSCMD_SKIP_SENDTELEMETRY=No way - - for /f "usebackq tokens=*" %%i in (`%VSWHERE% -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( - set InstallDir=%%i - ) - - if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" ( - echo "Found %InstallDir%\Common7\Tools\vsdevcmd.bat" - call "%InstallDir%\Common7\Tools\vsdevcmd.bat" %* - ) else "VC not found" + # shell: cmd + # run: | + # SET VSWHERE="C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere" + # SET VSCMD_SKIP_SENDTELEMETRY=No way + + # for /f "usebackq tokens=*" %%i in (`%VSWHERE% -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( + # set InstallDir=%%i + # ) + + # if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" ( + # echo "Found %InstallDir%\Common7\Tools\vsdevcmd.bat" + # call "%InstallDir%\Common7\Tools\vsdevcmd.bat" %* + # ) else "VC not found" - name: Set PHP SDK Environment variables shell: cmd From 8e927554ed189ca4aa9371a71c7c683b9472c707 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 11:43:49 +0300 Subject: [PATCH 136/164] Try combine for include for matrix :) --- .github/workflows/windows.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 106a79b9..1f6da0a2 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -33,19 +33,19 @@ jobs: 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 + # vc_num: 14 + # vc_prefix: 'vc' + # os: windows-2016 + - php: '7.2' vc_num: 15 vc_prefix: 'vc' - os: windows-2019 + os: windows-2016 - php: '7.3' vc_num: 15 From 3a0fb13836bb0f7ac54015e2e5283d8bab85de0b Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 11:45:26 +0300 Subject: [PATCH 137/164] Anothr try to combine includes --- .github/workflows/windows.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1f6da0a2..6855fbb7 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -32,8 +32,7 @@ jobs: build_type: ['ts', 'nts'] include: - - php: '7.0' - - php: '7.1' + - php: ['7.0', '7.1'] vc_num: 14 vc_prefix: 'vc' os: windows-2016 From 1615100bf0b0ab2a8049d5c17793dc21d80a04b0 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 13:57:19 +0300 Subject: [PATCH 138/164] Skip Win specific tests --- .github/workflows/windows.yml | 23 +++++------------------ tests/base/cblocks.phpt | 1 + tests/comments/comments_before.phpt | 1 + tests/errors/bug30.phpt | 1 + tests/skipifwin32.inc | 1 + 5 files changed, 9 insertions(+), 18 deletions(-) create mode 100644 tests/skipifwin32.inc diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6855fbb7..a72aa0d8 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -32,14 +32,15 @@ jobs: build_type: ['ts', 'nts'] include: - - php: ['7.0', '7.1'] + - php: '7.0' vc_num: 14 vc_prefix: 'vc' os: windows-2016 - # 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 @@ -117,20 +118,6 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{ matrix.arch }} - # toolset: ${{ matrix.vc_num }} - # shell: cmd - # run: | - # SET VSWHERE="C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere" - # SET VSCMD_SKIP_SENDTELEMETRY=No way - - # for /f "usebackq tokens=*" %%i in (`%VSWHERE% -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( - # set InstallDir=%%i - # ) - - # if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" ( - # echo "Found %InstallDir%\Common7\Tools\vsdevcmd.bat" - # call "%InstallDir%\Common7\Tools\vsdevcmd.bat" %* - # ) else "VC not found" - name: Set PHP SDK Environment variables shell: cmd diff --git a/tests/base/cblocks.phpt b/tests/base/cblocks.phpt index 26dc07b8..158977f4 100644 --- a/tests/base/cblocks.phpt +++ b/tests/base/cblocks.phpt @@ -2,6 +2,7 @@ Tests recognizing wrapping C-code in CBLOCKs --SKIPIF-- + --FILE-- + --FILE-- + --FILE-- From 7386e168cf601864d416301625d8277398eadd0d Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 14:12:56 +0300 Subject: [PATCH 139/164] Use lowercase for artifact name --- .ci/win-ci-tools.psm1 | 10 +++++----- .github/workflows/windows.yml | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.ci/win-ci-tools.psm1 b/.ci/win-ci-tools.psm1 index afdce288..19869b11 100644 --- a/.ci/win-ci-tools.psm1 +++ b/.ci/win-ci-tools.psm1 @@ -30,12 +30,12 @@ function InitializeReleaseVars { #> # 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 + # zephir-parser-php-7.0-nts-win32-vc14-x86.zip + # zephir-parser-php-7.0-ts-win32-vc14-x64.zip - $VC_Prefix = "VC" + $VC_Prefix = "vc" if (${env:VC_VERSION} -ge 16) { - $VC_Prefix = "VS" + $VC_Prefix = "vc" } # Configure for Windows define `BUILD_DIR` using the next logic: @@ -55,7 +55,7 @@ function InitializeReleaseVars { } $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}" + $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 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a72aa0d8..97a6e8ed 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -62,7 +62,7 @@ jobs: vc_prefix: 'vs' os: windows-2019 - name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-Win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}" + name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }}" runs-on: ${{ matrix.os}} steps: @@ -98,7 +98,7 @@ jobs: 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 }} + 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: | @@ -175,6 +175,7 @@ jobs: -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",` @@ -185,7 +186,7 @@ jobs: - 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 }} + name: zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-win32-${{ matrix.vc_prefix }}${{ matrix.vc_num }}-${{ matrix.arch }} path: | ${{ github.workspace }}\zephir-parser-*.zip @@ -204,7 +205,7 @@ jobs: 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 }} + 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 From 8ee7d58e14e8181f6c75e34948868aeb4ddf4c60 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Tue, 7 Sep 2021 12:50:18 +0100 Subject: [PATCH 140/164] #110 - Add PHP 8.1 --- .github/workflows/windows.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 97a6e8ed..2b91cac0 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.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 bee5d153dd29a5ed73a3ee7079921e39c6ecf8b9 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Tue, 7 Sep 2021 12:57:18 +0100 Subject: [PATCH 141/164] Revert "#110 - Add PHP 8.1" This reverts commit 8ee7d58e14e8181f6c75e34948868aeb4ddf4c60. --- .github/workflows/windows.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2b91cac0..97a6e8ed 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -27,7 +27,7 @@ jobs: fail-fast: false matrix: - php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] arch: ['x86', 'x64'] build_type: ['ts', 'nts'] @@ -62,11 +62,6 @@ 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 2590e3675efafed0359cb0027d08186d5fa85d6c Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Tue, 7 Sep 2021 12:58:10 +0100 Subject: [PATCH 142/164] Enable Linux and MacOS builds --- .github/workflows/{linux-macos.yml_disable => linux-macos.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{linux-macos.yml_disable => linux-macos.yml} (100%) diff --git a/.github/workflows/linux-macos.yml_disable b/.github/workflows/linux-macos.yml similarity index 100% rename from .github/workflows/linux-macos.yml_disable rename to .github/workflows/linux-macos.yml From 45a2cbe4e0800bbdac6da81042c76202a9d1774a Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 16:32:29 +0300 Subject: [PATCH 143/164] Refactor Ubuntu and macOS builds --- .github/workflows/linux-macos.yml | 37 ++++++++++++++++++------------- .github/workflows/windows.yml | 2 +- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/.github/workflows/linux-macos.yml b/.github/workflows/linux-macos.yml index 5f223ec0..a66fd2a5 100644 --- a/.github/workflows/linux-macos.yml +++ b/.github/workflows/linux-macos.yml @@ -19,16 +19,7 @@ jobs: fail-fast: false matrix: - re2c: - - '0.13.6' - - '1.3' - 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'] name: - Ubuntu - macOS @@ -42,10 +33,11 @@ jobs: os: macos-latest ccov: OFF - name: "${{ matrix.name }}: PHP ${{ matrix.php }}, re2c ${{ matrix.re2c }}" + name: "${{ matrix.name }}: PHP ${{ matrix.php }}" runs-on: ${{ matrix.os }} env: + RE2C_VERSION: 2.2 ZEND_DONT_UNLOAD_MODULES: 1 USE_ZEND_ALLOC: 0 @@ -60,6 +52,12 @@ jobs: php-version: '${{ matrix.php }}' coverage: none + - name: Cache RE2C Downloads + uses: actions/cache@v2 + with: + path: $HOME/.cache/re2c + key: ${{ runner.os }}-php-${{ matrix.php }}-re2c-${env:RE2C_VERSION} + - name: Setup Prerequisites (Linux) if: runner.os == 'Linux' run: | @@ -73,23 +71,22 @@ jobs: sudo xcode-select -switch /Applications/Xcode.app - name: Setup Build System (Generic) - if: runner.os != 'Windows' run: | ulimit -c unlimited -S || true mkdir -p $HOME/.cache/re2c mkdir -p $HOME/.local/opt/re2c - echo "RE2C_VERSION=${{ matrix.re2c }}" >> $GITHUB_ENV 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 ${{ matrix.re2c }} + - name: Install re2c run: .ci/install-re2c.sh - name: Build extensions @@ -114,8 +111,9 @@ jobs: run: make coverage-initial - name: Run Tests - if: runner.os != 'Windows' - run: make test NO_INTERACTION=1 REPORT_EXIT_STATUS=1 + run: | + php --ri 'Zephir Parser' + make test NO_INTERACTION=1 REPORT_EXIT_STATUS=1 - name: Print failures if: failure() && runner.os == 'Linux' @@ -133,3 +131,10 @@ jobs: file: ./lcov.info flags: unittests fail_ci_if_error: false + + - name: Upload Zephir Parser + uses: actions/upload-artifact@v2 + with: + name: zephir-parser-v${env:ZEPHIR_PARSER_VERSION}-php-${{ matrix.php }}-${{ runner.os }} + path: | + ${{ github.workspace }}\modules\*.so diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 97a6e8ed..59cab357 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -200,7 +200,7 @@ jobs: Get-Content -Path "${env:GITHUB_WORKSPACE}\${BaseName}.log" } - - name: Upload Infor for Debug on Fail + - name: Upload Info for Debug on Fail if: failure() uses: actions/upload-artifact@v2 with: From 730445bc56d7f7ceb5e9be378e20758014a56442 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 16:40:01 +0300 Subject: [PATCH 144/164] Load parser ext dynamically for test --- .github/workflows/linux-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-macos.yml b/.github/workflows/linux-macos.yml index a66fd2a5..e91f20b2 100644 --- a/.github/workflows/linux-macos.yml +++ b/.github/workflows/linux-macos.yml @@ -112,7 +112,7 @@ jobs: - name: Run Tests run: | - php --ri 'Zephir Parser' + php -d extension=./modules/zephir_parser.so --ri 'Zephir Parser' make test NO_INTERACTION=1 REPORT_EXIT_STATUS=1 - name: Print failures From 62d197d4c02ca8b8a968e3d2a76a565dba5031fb Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 16:50:35 +0300 Subject: [PATCH 145/164] Enable skip CI for selected OS --- .github/workflows/linux-macos.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux-macos.yml b/.github/workflows/linux-macos.yml index e91f20b2..de130976 100644 --- a/.github/workflows/linux-macos.yml +++ b/.github/workflows/linux-macos.yml @@ -15,6 +15,10 @@ on: jobs: ci: + # To prevent build a particular commit use + # git commit -m "......... [unix skip]" + if: "!contains(github.event.head_commit.message, '[unix skip]')" + strategy: fail-fast: false @@ -56,7 +60,7 @@ jobs: uses: actions/cache@v2 with: path: $HOME/.cache/re2c - key: ${{ runner.os }}-php-${{ matrix.php }}-re2c-${env:RE2C_VERSION} + key: ${{ runner.os }}-php-${{ matrix.php }}-re2c-${{env:RE2C_VERSION}} - name: Setup Prerequisites (Linux) if: runner.os == 'Linux' @@ -135,6 +139,6 @@ jobs: - name: Upload Zephir Parser uses: actions/upload-artifact@v2 with: - name: zephir-parser-v${env:ZEPHIR_PARSER_VERSION}-php-${{ matrix.php }}-${{ runner.os }} + name: zephir-parser-v${{env:ZEPHIR_PARSER_VERSION}}-php-${{ matrix.php }}-${{ runner.os }} path: | - ${{ github.workspace }}\modules\*.so + ${{ github.workspace }}/modules/*.so From f622dd7fa8d382ffe612c2f4a7adc3152f8095d6 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 16:55:14 +0300 Subject: [PATCH 146/164] Tets Windows build skip [win skip] --- .github/workflows/windows.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 59cab357..0d6e3e47 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -23,6 +23,10 @@ env: jobs: ci: + # To prevent build a particular commit use + # git commit -m "......... [win skip]" + if: "!contains(github.event.head_commit.message, '[win skip]')" + strategy: fail-fast: false From 33d060438a2e3a84d8e1b8d034b37f30f721c5bb Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 16:57:53 +0300 Subject: [PATCH 147/164] Fix env var syntax [win skip] --- .github/workflows/linux-macos.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux-macos.yml b/.github/workflows/linux-macos.yml index de130976..baf82521 100644 --- a/.github/workflows/linux-macos.yml +++ b/.github/workflows/linux-macos.yml @@ -60,7 +60,7 @@ jobs: uses: actions/cache@v2 with: path: $HOME/.cache/re2c - key: ${{ runner.os }}-php-${{ matrix.php }}-re2c-${{env:RE2C_VERSION}} + key: ${{ runner.os }}-php-${{ matrix.php }}-re2c-${{env.RE2C_VERSION}} - name: Setup Prerequisites (Linux) if: runner.os == 'Linux' @@ -139,6 +139,6 @@ jobs: - name: Upload Zephir Parser uses: actions/upload-artifact@v2 with: - name: zephir-parser-v${{env:ZEPHIR_PARSER_VERSION}}-php-${{ matrix.php }}-${{ runner.os }} + name: zephir-parser-v${{env.ZEPHIR_PARSER_VERSION}}-php-${{ matrix.php }}-${{ runner.os }} path: | ${{ github.workspace }}/modules/*.so From 513074c2a4edc4a7ab0f71bcea72c405dbe47455 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 17:07:11 +0300 Subject: [PATCH 148/164] Fix re2c chache path [win skip] --- .github/workflows/linux-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-macos.yml b/.github/workflows/linux-macos.yml index baf82521..337d0891 100644 --- a/.github/workflows/linux-macos.yml +++ b/.github/workflows/linux-macos.yml @@ -59,7 +59,7 @@ jobs: - name: Cache RE2C Downloads uses: actions/cache@v2 with: - path: $HOME/.cache/re2c + path: ~/.cache/re2c key: ${{ runner.os }}-php-${{ matrix.php }}-re2c-${{env.RE2C_VERSION}} - name: Setup Prerequisites (Linux) From b20c9fdebe099ee2e7f48874ceee8d75f26f26d3 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 20:36:18 +0300 Subject: [PATCH 149/164] Disable workflows --- .github/workflows/{linux-macos.yml => linux-macos.yml.disabled} | 0 .github/workflows/{windows.yml => windows.yml.disabled} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{linux-macos.yml => linux-macos.yml.disabled} (100%) rename .github/workflows/{windows.yml => windows.yml.disabled} (100%) diff --git a/.github/workflows/linux-macos.yml b/.github/workflows/linux-macos.yml.disabled similarity index 100% rename from .github/workflows/linux-macos.yml rename to .github/workflows/linux-macos.yml.disabled diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml.disabled similarity index 100% rename from .github/workflows/windows.yml rename to .github/workflows/windows.yml.disabled From 2fde5fad62c788498d071e3cec94f4a92267062d Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 20:44:03 +0300 Subject: [PATCH 150/164] Add windows builds flow --- .github/workflows/ci.yml | 216 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 216 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..324b323a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,216 @@ +name: CI + +on: + push: + branches-ignore: + - 'wip-*' + paths-ignore: + - '*.md' + pull_request: + branches: + - master + - development + schedule: + - cron: '0 11 * * *' + +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: + windows: + # 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'] + 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 + + 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 }} + 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* From 44871dd909700cb9c2736d7a239cd111b34a0f4b Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 20:53:45 +0300 Subject: [PATCH 151/164] Add unix flow --- .github/workflows/ci.yml | 135 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 133 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 324b323a..c93b2480 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,8 @@ name: CI on: + schedule: + - cron: '0 2 * * *' # Daily at 02:00 runs only on default branch push: branches-ignore: - 'wip-*' @@ -10,10 +12,9 @@ on: branches: - master - development - schedule: - - cron: '0 11 * * *' env: + RE2C_VERSION: 2.2 PHP_SDK_VERSION: 2.2.0 PHP_DEVPACK: C:\tools\php-devpack PHP_SDK_PATH: C:\tools\php-sdk @@ -214,3 +215,133 @@ jobs: ${{ github.workspace }}\parser ${{ github.workspace }}\Release* ${{ github.workspace }}\**\Release* + + unix: + # 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'] + name: + - Ubuntu + - macOS + + include: + - name: Ubuntu + os: ubuntu-18.04 + ccov: ON + + - name: macOS + os: macos-latest + ccov: OFF + + name: "${{ matrix.name }}: PHP ${{ matrix.php }}" + 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 + + - 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: 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-v${{env.ZEPHIR_PARSER_VERSION}}-php-${{ matrix.php }}-${{ runner.os }} + path: | + ${{ github.workspace }}/modules/*.so From ed2ca2323daf4db20170b29939a0c68122f47d2c Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 21:32:48 +0300 Subject: [PATCH 152/164] Fix naming for artifacts --- .github/workflows/ci.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c93b2480..dab6ab6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: CI +name: Zephir Parser CI on: schedule: @@ -227,20 +227,24 @@ jobs: matrix: php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] + arch: 'x64' + build_type: 'nts' name: - - Ubuntu - - macOS + - ubuntu + - macos include: - - name: Ubuntu + - name: ubuntu os: ubuntu-18.04 ccov: ON + compiler: gcc - - name: macOS + - name: macos os: macos-latest ccov: OFF + compiler: clang - name: "${{ matrix.name }}: PHP ${{ matrix.php }}" + name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }}" runs-on: ${{ matrix.os }} env: @@ -258,6 +262,8 @@ jobs: with: php-version: '${{ matrix.php }}' coverage: none + env: + PHPTS: ${{ matrix.build_type }} - name: Cache RE2C Downloads uses: actions/cache@v2 @@ -342,6 +348,6 @@ jobs: - name: Upload Zephir Parser uses: actions/upload-artifact@v2 with: - name: zephir-parser-v${{env.ZEPHIR_PARSER_VERSION}}-php-${{ matrix.php }}-${{ runner.os }} + name: zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }} path: | ${{ github.workspace }}/modules/*.so From 4ecea86e9be6d785a7b3250ad83c7d1882a70398 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 22:14:17 +0300 Subject: [PATCH 153/164] Add release flow --- .ci/release-parser.sh | 35 ++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 75 insertions(+), 4 deletions(-) create mode 100755 .ci/release-parser.sh diff --git a/.ci/release-parser.sh b/.ci/release-parser.sh new file mode 100755 index 00000000..4df60891 --- /dev/null +++ b/.ci/release-parser.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# 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. + + +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting. + +set -eu +set -o pipefail + +# Get Release notes for the latest release from CHANGELOG.md +# How to use: +# release-notes.sh CHANGELOG.md + +startline=$(cat "$1" | grep -nE "^### " | head -n 1 | cut -d ":" -f 1) +finishline=$(($(cat "$1" | grep -nE "^## \[\d" | 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/.github/workflows/ci.yml b/.github/workflows/ci.yml index dab6ab6a..77126f99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ env: EXTENSION_FILE: php_zephir_parser.dll jobs: - windows: + 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" @@ -190,7 +190,7 @@ jobs: - 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 }} + 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 @@ -216,7 +216,7 @@ jobs: ${{ github.workspace }}\Release* ${{ github.workspace }}\**\Release* - unix: + 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" @@ -348,6 +348,42 @@ jobs: - name: Upload Zephir Parser uses: actions/upload-artifact@v2 with: - name: zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }} + name: zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip path: | ${{ github.workspace }}/modules/*.so + + release: + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + + needs: [windows-builds, unix-builds] + name: Create Release + runs-on: ubuntu-20.04 + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - name: Get the release version + id: get-version + run: | + echo ::set-output name=version::${GITHUB_REF#refs/tags/} + echo ::set-output name=release_body::$(.ci/release-notes.sh CHANGELOG.md) + + - name: Download Zephir Parser build artifacts + id: download + uses: actions/download-artifact@v2 + run: | + ls -lah | grep "\.zip" + + - name: Create Release + uses: ncipollo/release-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + name: ${{ steps.get-version.outputs.version }} + tag: ${{ steps.get-version.outputs.version }} + body: ${{ steps.get-version.outputs.release_body }} + allowUpdates: true + artifacts: "${{steps.download.outputs.download-path}}/zephir-parser*.zip" + artifactContentType: application/octet-stream From 117dad9972815b6be05b88be6c79417d5d0d5306 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 22:16:59 +0300 Subject: [PATCH 154/164] Fix check release assets step --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77126f99..caa74cac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -374,6 +374,8 @@ jobs: - name: Download Zephir Parser build artifacts id: download uses: actions/download-artifact@v2 + + - name: Check for Release Assets run: | ls -lah | grep "\.zip" From f395ecfdf9bf473286ec3295cf6b430b069915e8 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 22:19:55 +0300 Subject: [PATCH 155/164] Fix matrics args --- .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 caa74cac..fac42759 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -227,8 +227,8 @@ jobs: matrix: php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] - arch: 'x64' - build_type: 'nts' + arch: ['x64'] + build_type: ['nts'] name: - ubuntu - macos From d09cd4e97dc543a23906dbe86e0c9f68409ad84d Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 22:22:37 +0300 Subject: [PATCH 156/164] Fix runner os name --- .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 fac42759..26ac668a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -244,7 +244,7 @@ jobs: ccov: OFF compiler: clang - name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }}" + name: "PHP-${{ matrix.php }}-${{ matrix.build_type }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}" runs-on: ${{ matrix.os }} env: @@ -348,7 +348,7 @@ jobs: - name: Upload Zephir Parser uses: actions/upload-artifact@v2 with: - name: zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip + name: zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip path: | ${{ github.workspace }}/modules/*.so From e61c3445ac85bab6986e97a36dfc5b684d4bc33e Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 22:49:18 +0300 Subject: [PATCH 157/164] Updates readme --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a12c44b3..019296c0 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ # Zephir Parser [![Actions Status][actions badge]][actions link] -[![Build on Windows][:badge-appveyor:]][:build-appveyor:] [![Coverage Status][:badge-codecov:]][:build-codecov:] [![License][:badge-license:]][:ext-license:] +[![Discord][:badge-discord:]][discord link] 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** and **8.0** **NOTE:** The [`development`][:dev-branch:] branch will always contain the latest **unstable** version. If you wish to @@ -145,12 +145,12 @@ 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 badge]: https://github.com/phalcon/php-zephir-parser/workflows/build/badge.svg +[actions badge]: https://github.com/zephir-lang/php-zephir-parser/actions/workflows/ci.yml/badge.svg -[:badge-appveyor:]: https://ci.appveyor.com/api/projects/status/r4k8baw1iy54v2wt/branch/development?svg=true +[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-license:]: https://img.shields.io/badge/license-MIT-brightgreen.svg -[:build-appveyor:]: https://ci.appveyor.com/project/sergeyklay/php-zephir-parser/branch/master [: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 From 063bc114dcf6a5eb6bdfda58fe21e43de5b04946 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Tue, 7 Sep 2021 22:53:14 +0300 Subject: [PATCH 158/164] Delete old workflows, skip builds for md files [ci skip] --- .github/workflows/ci.yml | 2 + .github/workflows/linux-macos.yml.disabled | 144 -------------- .github/workflows/windows.yml.disabled | 217 --------------------- 3 files changed, 2 insertions(+), 361 deletions(-) delete mode 100644 .github/workflows/linux-macos.yml.disabled delete mode 100644 .github/workflows/windows.yml.disabled diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26ac668a..b894e60d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,8 @@ on: paths-ignore: - '*.md' pull_request: + paths-ignore: + - '*.md' branches: - master - development diff --git a/.github/workflows/linux-macos.yml.disabled b/.github/workflows/linux-macos.yml.disabled deleted file mode 100644 index 337d0891..00000000 --- a/.github/workflows/linux-macos.yml.disabled +++ /dev/null @@ -1,144 +0,0 @@ -name: Linux and MacOS - -on: - push: - branches-ignore: - - 'wip-*' - paths-ignore: - - '*.md' - pull_request: - branches: - - master - - development - schedule: - - cron: '0 11 * * *' - -jobs: - ci: - # To prevent build a particular commit use - # git commit -m "......... [unix skip]" - if: "!contains(github.event.head_commit.message, '[unix skip]')" - - strategy: - fail-fast: false - - matrix: - php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] - name: - - Ubuntu - - macOS - - include: - - name: Ubuntu - os: ubuntu-18.04 - ccov: ON - - - name: macOS - os: macos-latest - ccov: OFF - - name: "${{ matrix.name }}: PHP ${{ matrix.php }}" - runs-on: ${{ matrix.os }} - - env: - RE2C_VERSION: 2.2 - 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 - - - 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: 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-v${{env.ZEPHIR_PARSER_VERSION}}-php-${{ matrix.php }}-${{ runner.os }} - path: | - ${{ github.workspace }}/modules/*.so diff --git a/.github/workflows/windows.yml.disabled b/.github/workflows/windows.yml.disabled deleted file mode 100644 index 0d6e3e47..00000000 --- a/.github/workflows/windows.yml.disabled +++ /dev/null @@ -1,217 +0,0 @@ -name: Windows - -on: - push: - branches-ignore: - - 'wip-*' - paths-ignore: - - '*.md' - -# pull_request: -# branches: -# - master -# - development - -# schedule: -# - cron: '0 11 * * *' - -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: - ci: - # To prevent build a particular commit use - # git commit -m "......... [win skip]" - if: "!contains(github.event.head_commit.message, '[win skip]')" - - strategy: - fail-fast: false - - matrix: - php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] - 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 - - 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 }} - 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* From fef7f5348f6ba93da09420a537ce424fef825774 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Wed, 8 Sep 2021 21:55:21 +0300 Subject: [PATCH 159/164] Fix release notes parser --- .ci/{release-parser.sh => release-notes.sh} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .ci/{release-parser.sh => release-notes.sh} (82%) diff --git a/.ci/release-parser.sh b/.ci/release-notes.sh similarity index 82% rename from .ci/release-parser.sh rename to .ci/release-notes.sh index 4df60891..03492db3 100755 --- a/.ci/release-parser.sh +++ b/.ci/release-notes.sh @@ -18,8 +18,8 @@ set -o pipefail # How to use: # release-notes.sh CHANGELOG.md -startline=$(cat "$1" | grep -nE "^### " | head -n 1 | cut -d ":" -f 1) -finishline=$(($(cat "$1" | grep -nE "^## \[\d" | head -n 2 | tail -n 1 | cut -d ":" -f 1) - 1)) +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"); From c564c29b0562da7151277014c951718511a02a34 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Wed, 8 Sep 2021 21:58:28 +0300 Subject: [PATCH 160/164] Fix macos build artifatcs attach --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b894e60d..6b7bb2cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -338,6 +338,12 @@ jobs: 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 @@ -352,7 +358,7 @@ jobs: with: name: zephir-parser-php-${{ matrix.php }}-${{ matrix.build_type }}-${{ matrix.name }}-${{ matrix.compiler }}-${{ matrix.arch }}.zip path: | - ${{ github.workspace }}/modules/*.so + ${{ github.workspace }}/modules/*.zip release: if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') From d99c34e084edd713634949f8f89d78f921dd4c4f Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Wed, 8 Sep 2021 22:02:03 +0300 Subject: [PATCH 161/164] Fix release action --- .github/workflows/ci.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b7bb2cd..16570bc0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -377,15 +377,19 @@ jobs: id: get-version run: | echo ::set-output name=version::${GITHUB_REF#refs/tags/} - echo ::set-output name=release_body::$(.ci/release-notes.sh CHANGELOG.md) - name: Download Zephir Parser build artifacts id: download uses: actions/download-artifact@v2 + with: + path: ./build-artifacts - - name: Check for Release Assets + - name: Prepare Release assets run: | - ls -lah | grep "\.zip" + 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 - name: Create Release uses: ncipollo/release-action@v1 @@ -393,7 +397,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} name: ${{ steps.get-version.outputs.version }} tag: ${{ steps.get-version.outputs.version }} - body: ${{ steps.get-version.outputs.release_body }} + bodyFile: "./build-artifacts/release/release-notes.md" allowUpdates: true - artifacts: "${{steps.download.outputs.download-path}}/zephir-parser*.zip" + artifacts: "./build-artifacts/release/*.zip" artifactContentType: application/octet-stream From 0d18970387eb378cfd9ff42e2b05514bf0fde3bf Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Wed, 8 Sep 2021 20:35:40 +0100 Subject: [PATCH 162/164] Remove .appveyor.yml --- .appveyor.yml | 159 -------------------------------------------------- 1 file changed, 159 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index aa7d433f..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,159 +0,0 @@ -version: 1.3.7-{build} - -environment: - matrix: - - - PHP_VERSION: 7.0 - VC_VERSION: 14 - BUILD_TYPE: "Win32" - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 - VCVARSALL: "%VS120COMNTOOLS%/../../VC/vcvarsall.bat" - - - PHP_VERSION: 7.0 - VC_VERSION: 14 - BUILD_TYPE: "nts-Win32" - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 - VCVARSALL: "%VS120COMNTOOLS%/../../VC/vcvarsall.bat" - - - PHP_VERSION: 7.1 - VC_VERSION: 14 - BUILD_TYPE: "Win32" - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 - VCVARSALL: "%VS120COMNTOOLS%/../../VC/vcvarsall.bat" - - - PHP_VERSION: 7.1 - VC_VERSION: 14 - BUILD_TYPE: "nts-Win32" - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 - VCVARSALL: "%VS120COMNTOOLS%/../../VC/vcvarsall.bat" - - - PHP_VERSION: 7.2 - VC_VERSION: 15 - BUILD_TYPE: "Win32" - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - VCVARSALL: "%VS140COMNTOOLS%/../../VC/vcvarsall.bat" - - - PHP_VERSION: 7.2 - VC_VERSION: 15 - BUILD_TYPE: "nts-Win32" - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - VCVARSALL: "%VS140COMNTOOLS%/../../VC/vcvarsall.bat" - - - PHP_VERSION: 7.3 - VC_VERSION: 15 - BUILD_TYPE: Win32 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - VCVARSALL: "%VS140COMNTOOLS%/../../VC/vcvarsall.bat" - - - PHP_VERSION: 7.3 - VC_VERSION: 15 - BUILD_TYPE: nts-Win32 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - VCVARSALL: "%VS140COMNTOOLS%/../../VC/vcvarsall.bat" - - - PHP_VERSION: 7.4 - VC_VERSION: 15 - BUILD_TYPE: Win32 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - VCVARSALL: "%VS140COMNTOOLS%/../../VC/vcvarsall.bat" - - - PHP_VERSION: 7.4 - VC_VERSION: 15 - BUILD_TYPE: nts-Win32 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - VCVARSALL: "%VS140COMNTOOLS%/../../VC/vcvarsall.bat" - - - PHP_VERSION: 8.0 - VC_VERSION: 16 - BUILD_TYPE: Win32 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - VCVARSALL: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvarsall.bat" - - - PHP_VERSION: 8.0 - VC_VERSION: 16 - BUILD_TYPE: nts-Win32 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - VCVARSALL: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvarsall.bat" - - PHP_SDK_VERSION: 2.1.9 - PHP_AVM: https://raw.githubusercontent.com/sergeyklay/php-appveyor/master/php-appveyor.psm1 - - TEST_PHP_EXECUTABLE: C:\php\php.exe - NO_INTERACTION: 1 - REPORT_EXIT_STATUS: 1 - -matrix: - fast_finish: true - -cache: - - 'C:\Downloads -> .appveyor.yml' - -clone_depth: 1 -clone_folder: C:\Projects\php-zephir-parser - -platform: - - x86 - - x64 - -branches: - only: - - master - - development - -init: - - ps: $DebugPreference = 'SilentlyContinue' # Continue - -install: - - ps: (new-object Net.WebClient).DownloadString($Env:PHP_AVM) | iex - - - ps: InstallPhpSdk $Env:PHP_SDK_VERSION $Env:VC_VERSION $Env:PLATFORM - - ps: InstallPhp $Env:PHP_VERSION $Env:BUILD_TYPE $Env:VC_VERSION $Env:PLATFORM - - ps: InstallPhpDevPack $Env:PHP_VERSION $Env:BUILD_TYPE $Env:VC_VERSION $Env:PLATFORM - - - ps: Import-Module .\.ci\AppVeyor.psm1 - - ps: AppendSessionPath - - ps: TuneUpPhp - -build_script: - - if NOT "%VCVARSALL%" == "" call "%VCVARSALL%" %PLATFORM% - - ps: InitializeBuildVars - - phpsdk_setvars - - cmd /c .ci\build-win32.bat - - phpize - - cmd: 'configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-zephir-parser=shared' - - cmd: nmake 2> compile-errors.log 1> compile.log - - ps: InitializeReleaseVars - -test_script: - - ps: >- - EnablePhpExtension ` - -Name zephir_parser ` - -PrintableName "Zephir Parser" ` - -ExtPath $Env:RELEASE_PATH - -after_test: - - ps: >- - PrepareReleasePackage ` - -PhpVersion $Env:PHP_VERSION ` - -BuildType $Env:BUILD_TYPE ` - -Platform $Env:PLATFORM ` - -ConverMdToHtml $true ` - -ReleaseFiles "${Env:RELEASE_PATH}\php_zephir_parser.dll",` - "${Env:APPVEYOR_BUILD_FOLDER}\LICENSE",` - "${Env:APPVEYOR_BUILD_FOLDER}\CREDITS",` - "${Env:APPVEYOR_BUILD_FOLDER}\VERSION",` - "${Env:APPVEYOR_BUILD_FOLDER}\NO_WARRANTY" - -artifacts: - - path: '.\$(RELEASE_ZIPBALL).zip' - type: zip - name: ZephirParser - -on_failure: - - ps: >- - if (Test-Path -Path "${Env:APPVEYOR_BUILD_FOLDER}\compile-errors.log") { - Get-Content -Path "${Env:APPVEYOR_BUILD_FOLDER}\compile-errors.log" - } - if (Test-Path -Path "${Env:APPVEYOR_BUILD_FOLDER}\compile.log") { - Get-Content -Path "${Env:APPVEYOR_BUILD_FOLDER}\compile.log" - } From 87bc0c24b5e1579b1b22e853498206cf3749bcd8 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Wed, 8 Sep 2021 20:39:16 +0100 Subject: [PATCH 163/164] Update CHANGELOG.md --- CHANGELOG.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 523db180..1a971e75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [1.3.8] - 2021-09-08 +### Changed +- Changed CI from AppVeyor to Github Actions [#110](https://github.com/phalcon/php-zephir-parser/issues/110) + ## [1.3.7] - 2021-08-13 ### Added -- Added support of `require_once` statement +- Added support of `require_once` statement [#107](https://github.com/zephir-lang/php-zephir-parser/pull/107) ## [1.3.6] - 2020-12-03 ### Added @@ -164,7 +168,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added - Initial stable release -[Unreleased]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.7...HEAD +[Unreleased]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.8...HEAD +[1.3.8]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.7...v1.3.8 [1.3.7]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.6...v1.3.7 [1.3.6]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.5...v1.3.6 [1.3.5]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.4...v1.3.5 From d1e65f70a46676f86af4c72242300668b60bc546 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Wed, 8 Sep 2021 20:56:11 +0100 Subject: [PATCH 164/164] Bump Zephir Parser version to `1.3.8` --- VERSION | 2 +- zephir_parser.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 3336003d..e05cb332 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.7 +1.3.8 diff --git a/zephir_parser.h b/zephir_parser.h index 956f4f39..1ef08044 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.3.7" +#define PHP_ZEPHIR_PARSER_VERSION "1.3.8" #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."