-
Couldn't load subscription status.
- Fork 8k
Add AppVeyor CI #2169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Add AppVeyor CI #2169
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b01463b
Add files to enable Windows tests with AppVeyor
mlocati 0cdbc7d
Disable xmlrpc extension
mlocati 46bf761
Revert "Disable xmlrpc extension"
mlocati 6302b2b
Merge branch 'master' into appveyor
mlocati 7fd9b8a
Reset the PATH variable in the compile script
mlocati 97112fe
Remove cygwin directory
mlocati File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| image: Visual Studio 2015 | ||
|
|
||
| clone_depth: 1 | ||
|
|
||
| cache: | ||
| - appveyor\temp\archives | ||
| - appveyor\temp\tools | ||
| - appveyor\temp\deps-x64 | ||
| - appveyor\temp\deps-x86 | ||
|
|
||
| platform: | ||
| - x64 | ||
| - x86 | ||
|
|
||
| build_script: | ||
| - ps: appveyor\compile.ps1 | ||
|
|
||
| test_script: | ||
| - set NO_INTERACTION=1 | ||
| - set REPORT_EXIT_STATUS=1 | ||
| - set PATH=%APPVEYOR_BUILD_FOLDER%\appveyor\temp\deps-%Platform%\bin;%PATH% | ||
| - appveyor\out-%Platform%\php.exe run-tests.php -p "%APPVEYOR_BUILD_FOLDER%\appveyor\out-%Platform%\php.exe" -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --set-timeout 120 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,222 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| Compile PHP. | ||
| .DESCRIPTION | ||
| This Powershell script compiles (or recompiles) PHP for Windows, in 32 or 64 bits. | ||
| .PARAMETER Bits | ||
| 32 to built for 32-bit PCs, 64 to build for 64-bit PCs. | ||
| By default, if an environment variable named "Platform" exists and evaluates to "x86" or "x64", we'll use it. | ||
| Otherwise this value will be 32 if the current PC is 32-bit or 64 if the current PC is 64-bit. | ||
| Subsequent calls to this script will re-use the previously number of bits (if not specified in the Bits parameter). | ||
| .NOTES | ||
| Author: Michele Locati <mlocati@gmail.com> | ||
| #> | ||
|
|
||
| # Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process -Force | ||
|
|
||
| param([Byte]$bits=0) | ||
|
|
||
| # Setup preferences variables | ||
|
|
||
| $ErrorActionPreference = "Stop" | ||
| $WarningPreference = "Stop" | ||
| $ConfirmPreference = "None" | ||
| $ProgressPreference = "SilentlyContinue" | ||
|
|
||
| # Define some functions | ||
|
|
||
| function GetArchive([string]$remote, [string]$local) { | ||
| if (!(Test-Path -Path $local)) { | ||
| Write-Host -NoNewline "Downloading: $remote... " | ||
| Invoke-WebRequest -Uri $remote -Method "Get" -OutFile $local | ||
| Write-Host "done." | ||
| } | ||
| } | ||
| function Unzip([string]$zipFile, [string]$destinationDirectory) { | ||
| if (!(Test-Path -Path $destinationDirectory)) { | ||
| Write-Host -NoNewline "Extracting: $zipFile... " | ||
| Add-Type -AssemblyName "System.IO.Compression.FileSystem" | ||
| [System.IO.Compression.ZipFile]::ExtractToDirectory($zipFile, $destinationDirectory) | ||
| Write-Host "done." | ||
| } | ||
| } | ||
|
|
||
| function Un7z([string]$7zipFile, [string]$destinationDirectory) { | ||
| Write-Host -NoNewline "Extracting: $7zipFile... " | ||
| & $7zipExe x -bd -y -o"$destinationDirectory" "$7zipFile" | Out-Null | ||
| if (!($?)) { | ||
| Write-Host "failed!" | ||
| exit 1 | ||
| } | ||
| Write-Host "done." | ||
| } | ||
|
|
||
| # Setup variables | ||
| $scriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent | ||
| $sourceDirectory = Split-Path -Path $scriptDirectory -Parent | ||
| $tempDirectory = Join-Path -Path $scriptDirectory -ChildPath "temp" | ||
| $lastBuiltBitsFile = Join-Path -Path $tempDirectory -ChildPath "last.bits" | ||
| $previousBits = 0 | ||
| if (Test-Path -Path $lastBuiltBitsFile) { | ||
| switch (Get-Content -LiteralPath $lastBuiltBitsFile -ReadCount 1) { | ||
| "32" { | ||
| $previousBits = 32 | ||
| } | ||
| "64" { | ||
| $previousBits = 64 | ||
| } | ||
| } | ||
| } | ||
| if ($bits -eq 0) { | ||
| if ($previousBits -eq 0) { | ||
| if ($env:Platform -eq "x64") { | ||
| $bits = 64 | ||
| } elseif ($env:Platform -eq "x86") { | ||
| $bits = 32 | ||
| } elseif ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") { | ||
| $bits = 64 | ||
| } else { | ||
| $bits = 32 | ||
| } | ||
| } else { | ||
| $bits = $previousBits | ||
| } | ||
| } | ||
| switch ($bits) { | ||
| 32 { | ||
| $architectureName = "x86" | ||
| $architectureName2 = "x86" | ||
| } | ||
| 64 { | ||
| $architectureName = "x64" | ||
| $architectureName2 = "amd64" | ||
| } | ||
| default { | ||
| Write-Host "Invalid number of bits: $bits" | ||
| exit 1 | ||
| } | ||
| } | ||
| $archivesDirectory = Join-Path -Path $tempDirectory -ChildPath "archives" | ||
| $7zipArchive = Join-Path -Path $archivesDirectory -ChildPath "7zip.zip" | ||
| $7zipFolder = Join-Path -Path $archivesDirectory -ChildPath "7zip" | ||
| $7zipExe = Join-Path -Path $7zipFolder -ChildPath "7za.exe" | ||
| $toolsArchive = Join-Path -Path $archivesDirectory -ChildPath "php-sdk-binary-tools.zip" | ||
| $toolsDirectory = Join-Path -Path $tempDirectory -ChildPath "tools" | ||
| $dependenciesArchive = Join-Path -Path $archivesDirectory -ChildPath "deps-$architectureName.7z" | ||
| $dependenciesDirectory = Join-Path -Path $tempDirectory -ChildPath "deps-$architectureName" | ||
| $objOutDirectory = Join-Path -Path $tempDirectory -ChildPath "obj-$architectureName" | ||
| $visualStudioRoot=$env:VS140COMNTOOLS | ||
| $visualStudioRoot = Split-Path -Path $visualStudioRoot -Parent | ||
| $visualStudioRoot = Split-Path -Path $visualStudioRoot -Parent | ||
| $vcvarsall = Join-Path -Path $visualStudioRoot -ChildPath "VC" | ||
| $vcvarsall = Join-Path -Path $vcvarsall -ChildPath "vcvarsall.bat" | ||
| $outputDirectory = Join-Path -Path $scriptDirectory -ChildPath "out-$architectureName" | ||
| $scriptFile = Join-Path -Path $tempDirectory -ChildPath "compile.cmd" | ||
| $configure = $true | ||
| if (Test-Path $outputDirectory) { | ||
| if ($bits -eq $previousBits) { | ||
| $configure = $false | ||
| } else { | ||
| Remove-Item -Recurse -Force -LiteralPath $outputDirectory | ||
| } | ||
| } | ||
| if ($configure) { | ||
| if (Test-Path -Path $objOutDirectory) { | ||
| Remove-Item -Recurse -LiteralPath $objOutDirectory | ||
| } | ||
| if (Test-Path -Path $lastBuiltBitsFile) { | ||
| Remove-Item -LiteralPath $lastBuiltBitsFile | ||
| } | ||
| } | ||
| if (!(Test-Path -Path $objOutDirectory)) { | ||
| New-Item -Path $objOutDirectory -ItemType "directory" | Out-Null | ||
| } | ||
|
|
||
| # Prepare the required tools and dependencies | ||
| if (!(Test-Path -Path $tempDirectory)) { | ||
| New-Item -Path $tempDirectory -ItemType "directory" | Out-Null | ||
| } | ||
| if (!(Test-Path -Path $archivesDirectory)) { | ||
| New-Item -Path $archivesDirectory -ItemType "directory" | Out-Null | ||
| } | ||
| GetArchive "http://www.7-zip.org/a/7za920.zip" $7zipArchive | ||
| GetArchive "http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip" $toolsArchive | ||
| GetArchive "http://windows.php.net/downloads/php-sdk/deps-master-vc14-$architectureName.7z" $dependenciesArchive | ||
|
|
||
| # Prepare 7-zip | ||
| Unzip $7zipArchive $7zipFolder | ||
|
|
||
| # Decompress the PHP SDK Binary tools | ||
| Unzip $toolsArchive $toolsDirectory | ||
|
|
||
| # Decompress dependencies archive | ||
| if (!(Test-Path -Path $dependenciesDirectory)) { | ||
| Un7z $dependenciesArchive $archivesDirectory | ||
| $un7z = Join-Path -Path $archivesDirectory -ChildPath "deps" | ||
| Move-Item -Path $un7z -Destination $dependenciesDirectory | ||
| } | ||
|
|
||
| # Build the build script | ||
| $batch = @" | ||
| @echo off | ||
| setlocal | ||
|
|
||
| call `"$vcvarsall`" $architectureName2 | ||
| if errorlevel 1 exit /b 1 | ||
| call `"$toolsDirectory\bin\phpsdk_setvars.bat`" | ||
| if errorlevel 1 exit /b 1 | ||
| cd /D `"$sourceDirectory`" | ||
| if errorlevel 1 exit /b 1 | ||
| "@ | ||
| if ($configure) { | ||
| $batch = @" | ||
| $batch | ||
| nmake clean >NUL 2>NUL | ||
| call buildconf.bat --force | ||
| if errorlevel 1 exit /b 1 | ||
| mkdir "$outputDirectory" | ||
| if errorlevel 1 exit /b 1 | ||
| call configure.bat ^ | ||
| --enable-snapshot-build ^ | ||
| --enable-debug-pack ^ | ||
| --enable-com-dotnet=shared ^ | ||
| --with-mcrypt=static ^ | ||
| --without-analyzer ^ | ||
| `"--enable-object-out-dir=$objOutDirectory`" ^ | ||
| `"--with-prefix=$outputDirectory`" ^ | ||
| `"--with-php-build=$dependenciesDirectory`" ^ | ||
| --with-mp=auto ^ | ||
| --without-xmlrpc | ||
| if errorlevel 1 exit /b 1 | ||
| echo $bits>`"$lastBuiltBitsFile`" | ||
|
|
||
| "@ | ||
| } | ||
| $batch = @" | ||
| $batch | ||
|
|
||
| nmake /NOLOGO /S | ||
| if errorlevel 1 exit /b 1 | ||
|
|
||
| nmake /NOLOGO /S install | ||
| if errorlevel 1 exit /b 1 | ||
|
|
||
| exit /b 0 | ||
| "@ | ||
|
|
||
| if ($configure) { | ||
| Write-Host "Configuring and compiling for $bits bits" | ||
| } else { | ||
| Write-Host "Compiling for $bits bits" | ||
| } | ||
| $batch | Out-File -FilePath $scriptFile -Encoding "ascii" | ||
|
|
||
| $ErrorActionPreference = "SilentlyContinue" | ||
| & $scriptFile | ||
| $scriptExitCode = $LastExitCode | ||
| $ErrorActionPreference = "Stop" | ||
| Remove-Item -LiteralPath $scriptFile | ||
| if ($scriptExitCode -ne 0) { | ||
| Write-Host "Build script failed!" | ||
| exit 1 | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a good idea to disable that, there were changes in the last day to bundled libxmlrpc, there may be a problem on windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I thought there could be some problems with it... But I wanted to see the AppVeyor running tests 😉