Permalink
Browse files

Build Phalcon for PHP 7.3 on AppVeyor

  • Loading branch information...
sergeyklay committed Jan 10, 2019
1 parent 0fed8b0 commit d59a90f7dc2af907c69ef9a626e39e6aa34dd755
Showing with 188 additions and 655 deletions.
  1. +64 −0 .ci/appveyor.psm1
  2. +1 −1 .travis.yml
  3. +114 −60 appveyor.yml
  4. +9 −8 build/.gitignore
  5. +0 −586 tests/_ci/appveyor.psm1
@@ -0,0 +1,64 @@
# This file is part of the Phalcon Framework.
#
# (c) Phalcon Team <team@phalconphp.com>
#
# For the full copyright and license information, please view
# the LICENSE.txt file that was distributed with this source code.

function InitializeBuildVars {
switch ($Env:VC_VERSION) {
'14' {
if (-not (Test-Path $Env:VS120COMNTOOLS)) {
throw 'The VS120COMNTOOLS environment variable is not set. Check your MS VS installation'
}
$Env:VSCOMNTOOLS = $Env:VS120COMNTOOLS -replace '\\$', ''

break
}
'15' {
if (-not (Test-Path $Env:VS140COMNTOOLS)) {
throw 'The VS140COMNTOOLS environment variable is not set. Check your MS VS installation'
}
$Env:VSCOMNTOOLS = $Env:VS140COMNTOOLS -replace '\\$', ''
break
}
default {
throw 'This script is designed to run with MS VS 14/15. Check your MS VS installation'
break
}
}

if ($Env:PLATFORM -eq 'x64') {
$Env:ARCH = 'x86_amd64'
} else {
$Env:ARCH = 'x86'
}

$SearchFilter = 'vcvarsall.bat'
$SearchInFolder = "${Env:VSCOMNTOOLS}\..\..\"

$Env:VCVARSALL_FILE = Get-ChildItem -Path $SearchInFolder -Filter $SearchFilter -Recurse -ErrorAction SilentlyContinue |
ForEach-Object { $_.FullName }
}

function InitializeReleaseVars {
if ($Env:BUILD_TYPE -Match "nts-Win32") {
$Env:RELEASE_ZIPBALL = "phalcon_${Env:PLATFORM}_vc${Env:VC_VERSION}_php${Env:PHP_MINOR}_${Env:APPVEYOR_BUILD_VERSION}_nts"

if ($Env:PLATFORM -eq 'x86') {
$Env:RELEASE_FOLDER = "Release"
} else {
$Env:RELEASE_FOLDER = "x64\Release"
}
} else {
$Env:RELEASE_ZIPBALL = "phalcon_${Env:PLATFORM}_vc${Env:VC_VERSION}_php${Env:PHP_MINOR}_${Env:APPVEYOR_BUILD_VERSION}"

if ($Env:PLATFORM -eq 'x86') {
$Env:RELEASE_FOLDER = "Release_TS"
} else {
$Env:RELEASE_FOLDER = "x64\Release_TS"
}
}

$Env:RELEASE_DLL_PATH = "${Env:APPVEYOR_BUILD_FOLDER}\build\php7\safe\${Env:RELEASE_FOLDER}\php_phalcon.dll"
}
@@ -52,7 +52,7 @@ services:
env:
global:
- CC="gcc"
- ZEPHIR_VERSION="0.11.8"
- ZEPHIR_VERSION="0.11.9"
- ZEPHIR_PARSER_VERSION="v1.1.4"
- RE2C_VERSION="1.1.1"
- REPORT_COVERAGE=1
@@ -1,91 +1,145 @@
# This file is part of the Phalcon Framework.
#
# (c) Phalcon Team <team@phalconphp.com>
#
# For the full copyright and license information, please view
# the LICENSE.txt file that was distributed with this source code.

version: 4.0.0-alpha.2+{build}

environment:
matrix:
- PHP_MINOR: 7.2
VC_VERSION: 15
BUILD_TYPE: Win32
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- PHP_MINOR: 7.2
VC_VERSION: 15
BUILD_TYPE: nts-Win32
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
PHP_PATH: C:\Projects\php
PHP_SDK_PATH: C:\Projects\php-sdk
PHP_DEVPACK: C:\Projects\php-devpack
TEST_PHP_EXECUTABLE: C:\Projects\php\php.exe
PHP_SDK_VERSION: 2.0.7
PACKAGE_PREFIX: phalcon
EXTENSION_NAME: phalcon
EXTENSION_FILE: php_phalcon.dll
NO_INTERACTION: 1
REPORT_EXIT_STATUS: 1
COMPOSER_NO_INTERACTION: 1
PARSER_VERSION: 1.1.4
PARSER_RELEASE: 418
PSR_PECL_VERSION: 0.6.1
ZEPHIR_VERSION: 0.11.8
matrix:
- PHP_VERSION: 7.2
VC_VERSION: 15
BUILD_TYPE: Win32
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015

- PHP_VERSION: 7.2
VC_VERSION: 15
BUILD_TYPE: nts-Win32
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015

- PHP_VERSION: 7.3
VC_VERSION: 15
BUILD_TYPE: Win32
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015

- PHP_VERSION: 7.3
VC_VERSION: 15
BUILD_TYPE: nts-Win32
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015

PHP_AVM: https://raw.githubusercontent.com/sergeyklay/php-appveyor/master/php-appveyor.psm1

PHP_SDK_VERSION: 2.1.9
PECL_PSR_VERSION: 0.6.1
ZEPHIR_PARSER_VERSION: 1.2.0
ZEPHIR_PARSER_RELEASE: 454
ZEPHIR_VERSION: 0.11.9

TEST_PHP_EXECUTABLE: C:\php\php.exe
NO_INTERACTION: 1
REPORT_EXIT_STATUS: 1
COMPOSER_NO_INTERACTION: 1

matrix:
fast_finish: true
fast_finish: true

cache:
- 'C:\Downloads -> appveyor.yml'
- 'vendor -> composer.json'
- 'composer.phar -> composer.json'
- 'C:\Downloads -> appveyor.yml'

clone_depth: 1
clone_folder: c:\projects\phalcon

platform:
- x86
- x64
- x86
- x64

branches:
only:
- master
- 4.0.x

init:
- ps: $DebugPreference = 'SilentlyContinue' # Continue

install:
- ps: Import-Module .\tests\_ci\appveyor.psm1
- ps: AppendSessionPath
- ps: SetupPhpVersionString
- ps: EnsureRequiredDirectoriesPresent
- ps: Ensure7ZipIsInstalled
- ps: InstallSdk
- ps: InstallPhp
- ps: InstallPhpDevPack
- ps: InstallPsrExtension
- ps: InstallParser
- ps: InstallZephir
- ps: TuneUpPhp
- ps: (new-object Net.WebClient).DownloadString($Env:PHP_AVM) | iex

- ps: InstallPhpSdk $Env:PHP_SDK_VERSION $Env:VC_VERSION $Env:PLATFORM
- ps: InstallPhp $Env:PHP_VERSION $Env:BUILD_TYPE $Env:VC_VERSION $Env:PLATFORM
- ps: InstallPhpDevPack $Env:PHP_VERSION $Env:BUILD_TYPE $Env:VC_VERSION $Env:PLATFORM

- ps: TuneUpPhp -DefaultExtensions openssl,mbstring,pdo_sqlite,fileinfo,gettext,gd2
- ps: InstallComposer
- ps: InstallZephir -Version $Env:ZEPHIR_VERSION

- ps: >-
InstallPeclExtension `
-Name psr `
-Version $Env:PECL_PSR_VERSION `
-PhpVersion $Env:PHP_VERSION `
-BuildType $Env:BUILD_TYPE `
-VC $Env:VC_VERSION `
-Platform $Env:PLATFORM
- ps: >-
InstallZephirParser `
-Version $Env:ZEPHIR_PARSER_VERSION `
-BuildId $Env:ZEPHIR_PARSER_RELEASE `
-PhpVersion $Env:PHP_VERSION `
-BuildType $Env:BUILD_TYPE `
-VC $Env:VC_VERSION `
-Platform $Env:PLATFORM
before_build:
- ps: EnablePhpExtension -Name psr
- ps: EnablePhpExtension -Name zephir_parser -PrintableName "Zephir Parser"

build_script:
- ps: Import-Module .\.ci\appveyor.psm1
- ps: InitializeBuildVars
- cmd: '"%VSCOMNTOOLS%\VsDevCmd" -arch=%PLATFORM%'
- cmd: '"%VCVARSALL_FILE%" %ARCH%'
- cmd: C:\php-sdk\bin\phpsdk_setvars
- cmd: C:\php\php.exe zephir.phar generate --backend=ZendEngine3 -Wnonexistent-function -Wnonexistent-class -Wunused-variable
- ps: Set-Location "${Env:APPVEYOR_BUILD_FOLDER}\build"
- cmd: C:\php\php.exe gen-build.php
- ps: Set-Location "${Env:APPVEYOR_BUILD_FOLDER}\build\php7\safe"
- cmd: C:\php-devpack\phpize
- cmd: configure --with-prefix=C:\php --with-php-build=C:\php-devpack --disable-all --enable-phalcon
- cmd: nmake 2> compile-errors.log 1> compile.log
- ps: InitializeReleaseVars
- ps: InstallBuildDependencies
- '"%VSCOMNTOOLS%\VsDevCmd" %PLATFORM%'
- '"%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %ARCH%'
- '%PHP_SDK_PATH%\bin\phpsdk_setvars'
- '%APPVEYOR_BUILD_FOLDER%\zephir.bat generate --backend=ZendEngine3 -Wnonexistent-function -Wnonexistent-class -Wunused-variable'
- 'cd %APPVEYOR_BUILD_FOLDER%\build'
- 'php gen-build.php'
- 'cd %APPVEYOR_BUILD_FOLDER%\build\php7\safe'
- '%PHP_DEVPACK%\phpize.bat'
- 'configure --with-prefix=%PHP_PATH% --with-php-build=%PHP_DEVPACK% --disable-all --enable-phalcon'
- nmake 2> compile-errors.log 1> compile.log
- ps: EnableExtension

after_build:
- ps: PrepareReleasePackage
- ps: Set-Location "${Env:APPVEYOR_BUILD_FOLDER}"
- ps: >-
PrepareReleasePackage `
-PhpVersion $Env:PHP_VERSION `
-BuildType $Env:BUILD_TYPE `
-Platform $Env:PLATFORM `
-ConverMdToHtml $true `
-ReleaseFiles "${Env:RELEASE_DLL_PATH}",`
"${Env:APPVEYOR_BUILD_FOLDER}\LICENSE-PHP.txt",`
"${Env:APPVEYOR_BUILD_FOLDER}\LICENSE-ZEND.txt"
artifacts:
- path: '.\$(RELEASE_ZIPBALL).zip'
type: zip
name: Phalcon

on_failure :
- ps: PrintLogs "${Env:APPVEYOR_BUILD_FOLDER}\build\php7\safe"
- ps: PrintVars
- ps: PrintDirectoriesContent
- ps: PrintPhpInfo
on_failure:
- ps: $LogsDirectory = "${Env:APPVEYOR_BUILD_FOLDER}\build\php7\safe"
- ps: $FilterPattern = "(warning C4267)|(warning C4244)|(warning C4018)"

- ps: >-
if (Test-Path -Path "${LogsDirectory}\compile-errors.log") {
Get-Content -Path "${LogsDirectory}\compile-errors.log" | Where-Object {
$_ -notMatch "${FilterPattern}"
}
}
if (Test-Path -Path "${LogsDirectory}\compile.log") {
Get-Content -Path "${LogsDirectory}\compile.log" | Where-Object {
$_ -notMatch "${FilterPattern}"
}
}
@@ -29,11 +29,12 @@ modules/
run-tests.php
coverage/

php*/64bits/acinclude.m4
php*/64bits/aclocal.m4
php*/64bits/build/
php*/64bits/config.guess
php*/64bits/config.h
php*/64bits/config.nice
php*/64bits/config.status
php*/64bits/config.sub
php*/*/acinclude.m4
php*/*/aclocal.m4
php*/*/build/
php*/*/config.guess
php*/*/config.h
php*/*/config.nice
php*/*/config.nice.bat
php*/*/config.status
php*/*/config.sub
Oops, something went wrong.

0 comments on commit d59a90f

Please sign in to comment.