From 10c6487e2c062123516b449f975fa9fc912cf06a Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Sun, 29 Aug 2021 22:16:00 +0300 Subject: [PATCH 01/66] 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 02/66] 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 03/66] 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 04/66] 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 05/66] 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 06/66] 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 07/66] 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 08/66] 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 09/66] 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 10/66] 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 11/66] 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 12/66] 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 13/66] 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 14/66] 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 15/66] 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 16/66] 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 17/66] 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 18/66] 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 19/66] 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 20/66] 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 21/66] 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 22/66] 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 23/66] 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 24/66] 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 25/66] 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 26/66] 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 27/66] 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 28/66] 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 29/66] 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 30/66] 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 31/66] 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 32/66] 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 33/66] 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 34/66] 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 35/66] 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 36/66] 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 37/66] 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 38/66] 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 39/66] 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 40/66] 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 41/66] 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 42/66] 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 43/66] 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 44/66] 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 45/66] 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 46/66] 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 47/66] 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 48/66] 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 49/66] 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 50/66] 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 51/66] 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 52/66] 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 53/66] 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 54/66] 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 55/66] 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 56/66] 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 57/66] 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 58/66] 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 59/66] 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 60/66] 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 61/66] 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 62/66] 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 63/66] 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 64/66] 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 65/66] 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 66/66] 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