msphpsql/appveyor.yml

174 строки
9.0 KiB
YAML
Исходник Обычный вид История

2017-01-11 00:59:16 +03:00
version: '{branch}.{build}'
2017-01-11 00:59:16 +03:00
branches:
# whitelist
2017-01-11 01:03:57 +03:00
#only:
2017-01-11 00:59:16 +03:00
# blacklist
except:
- PHP-7.0-Linux
- PHP5
environment:
# MSSQL credentials from https://www.appveyor.com/docs/services-databases/
TEST_PHP_SQL_PWD: Password12!
TEST_PHP_SQL_UID: sa
SQLSRV_DBNAME: msphpsql_sqlsrv
PDOSQLSRV_DBNAME: msphpsql_pdosqlsrv
PYTHON: c:\Python36
# For details about Appveyor build worker images (VM template): https://www.appveyor.com/docs/build-environment/#build-worker-images
matrix:
2018-04-21 02:54:30 +03:00
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
BUILD_PLATFORM: x64
2018-04-24 17:37:53 +03:00
TEST_PHP_SQL_SERVER: (local)\SQL2017
SQL_INSTANCE: SQL2017
2018-04-21 02:54:30 +03:00
PHP_VC: 15
PHP_MAJOR_VER: 7.2
2018-12-08 02:03:48 +03:00
PHP_MINOR_VER: 11
2018-04-21 02:54:30 +03:00
PHP_EXE_PATH: x64\Release_TS
THREAD: ts
platform: x64
2018-04-24 06:33:49 +03:00
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
BUILD_PLATFORM: x86
2018-04-24 17:37:53 +03:00
TEST_PHP_SQL_SERVER: (local)\SQL2016
SQL_INSTANCE: SQL2016
2018-04-24 06:33:49 +03:00
PHP_VC: 14
PHP_MAJOR_VER: 7.1
PHP_MINOR_VER: latest
PHP_EXE_PATH: Release
THREAD: nts
platform: x86
# PHP_MAJOR_VER is PHP major version to build (7.2, 7.1)
# PHP_MINOR_VER is PHP point release number (or latest for latest release)
2017-01-11 00:59:16 +03:00
# PHP_VC is the Visual C++ version
# PHP_EXE_PATH is the relative path from php src folder to php executable
# THREAD is either non-thread-safe (nts) or thread-safe (ts)
2017-01-11 00:59:16 +03:00
matrix:
fast_finish: true
2017-01-11 00:59:16 +03:00
# clone directory (or %APPVEYOR_BUILD_FOLDER%)
clone_folder: c:\projects\sqlphp
build:
parallel: true # enable MSBuild parallel builds
install:
- echo start SQL Server
# Based on http://www.appveyor.com/docs/services-databases
- ps: >-
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null;
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null;
2017-01-11 00:59:16 +03:00
$instanceName = $env:SQL_INSTANCE;
$uri = "ManagedComputer[@Name='$env:COMPUTERNAME']/ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Tcp']";
$wmi = New-Object ('Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer');
$tcp = $wmi.GetSmoObject($uri);
$tcp.IsEnabled = $true;
$tcp.Alter();
Start-Service "MSSQL`$$instanceName";
Set-Service SQLBrowser -StartupType Manual;
Start-Service SQLBrowser;
2018-02-21 19:57:05 +03:00
- echo Downloading prerequisites
2018-02-21 20:10:22 +03:00
- ps: |
$client = New-Object Net.WebClient;
$client.Headers.Add("user-agent", "appveyor-ci-build2");
2018-02-21 19:57:05 +03:00
$client.DownloadFile("http://windows.php.net/downloads/releases/sha1sum.txt", "c:\projects\sha1sum.txt");
2017-01-11 00:59:16 +03:00
If ($env:PHP_MINOR_VER -Match "latest") {
2018-02-21 03:46:53 +03:00
$env:PHP_VERSION=type c:\projects\sha1sum.txt | where { $_ -match "php-($env:PHP_MAJOR_VER\.\d+)-src" } | foreach { $matches[1] } ;
2017-01-11 00:59:16 +03:00
} Else {
$env:PHP_VERSION=$env:PHP_MAJOR_VER + '.' + $env:PHP_MINOR_VER;
}
Dev (#820) * Fixed the potential error reported by Prefast code analysis * Use SQLSRV_ASSERT for checking NULL ptrs * For these AKV tests check env despite not AE connected * Added the driver option to run functional tests * Fixed connection pooling tests for more than one ODBC drivers * added driver option to pdo isPooled.php * Removed win32 ifdefs re connection resiliency (#802) * Set the driver argument for getDSN to null by default (#798) * Added the driver argument to getDSN * Dropped the driver argument but set to null as default * Removed the AE condition in locale support * Modified the AE condition for locale support * Changed int to SQLLEN to avoid infinite loop (#806) * Version 5.3.0 (#803) * Version 5.3.0 * Fixed the wrong replacements * Added comments block to m4 files * Use dnl for comments * Modified AE fetch phptypes test to insert only one row at a time and loop through php types (#801) * Modified AE fetch phptypes test to insert only one row at a time and loop through php types * Fixed formatting * Streamlined two very similar large column name tests (#807) * Streamlined two very similar large column name tests * Changed the EOL * Updates to change log and readme (#811) * Updates to change log and readme * Dropped support for Ubuntu 17 * Modified as per review comments * Fixed connection resiliency tests for Unix, updated AppVeyor for ODBC 17.2 * Fixed expected output * Fixed output and skipifs * Fixed skipifs and output * Fixed driver name * Updated installation instructions and sample script (#813) * Updated instructions and sample test for 5.3.0 RTW * Fixed sample code to adhere to php coding standard * Fixed cases and spaces * Modified NOTE for UB 18.04 based on review comments * Added 'exit' * Modified change log and readme based on review to PR 811 * Applied review comments * build output to debug appveyor failure * removed debug output * Streamlined two very similar large column name tests (#815) * Streamlined two very similar large column name tests * Added random number of test table names to avoid operand clash issues * Replaced to with for based on review * Changelog updated * changelog updated, test skipif changed to run on unix platforms * Fixed skipif typo * Fixed typo in skipif for pdo * Fixed some output for Travis * Moved error checking inside pdo connres tests * Added links back to changelog * Fixed output for sqlsrv connres tests * Fixed output * Fixed output again
2018-07-21 03:24:48 +03:00
- echo Downloading MSODBCSQL 17.2
2017-05-10 18:47:42 +03:00
# AppVeyor build works are x64 VMs and 32-bit ODBC driver cannot be installed on it
Dev (#820) * Fixed the potential error reported by Prefast code analysis * Use SQLSRV_ASSERT for checking NULL ptrs * For these AKV tests check env despite not AE connected * Added the driver option to run functional tests * Fixed connection pooling tests for more than one ODBC drivers * added driver option to pdo isPooled.php * Removed win32 ifdefs re connection resiliency (#802) * Set the driver argument for getDSN to null by default (#798) * Added the driver argument to getDSN * Dropped the driver argument but set to null as default * Removed the AE condition in locale support * Modified the AE condition for locale support * Changed int to SQLLEN to avoid infinite loop (#806) * Version 5.3.0 (#803) * Version 5.3.0 * Fixed the wrong replacements * Added comments block to m4 files * Use dnl for comments * Modified AE fetch phptypes test to insert only one row at a time and loop through php types (#801) * Modified AE fetch phptypes test to insert only one row at a time and loop through php types * Fixed formatting * Streamlined two very similar large column name tests (#807) * Streamlined two very similar large column name tests * Changed the EOL * Updates to change log and readme (#811) * Updates to change log and readme * Dropped support for Ubuntu 17 * Modified as per review comments * Fixed connection resiliency tests for Unix, updated AppVeyor for ODBC 17.2 * Fixed expected output * Fixed output and skipifs * Fixed skipifs and output * Fixed driver name * Updated installation instructions and sample script (#813) * Updated instructions and sample test for 5.3.0 RTW * Fixed sample code to adhere to php coding standard * Fixed cases and spaces * Modified NOTE for UB 18.04 based on review comments * Added 'exit' * Modified change log and readme based on review to PR 811 * Applied review comments * build output to debug appveyor failure * removed debug output * Streamlined two very similar large column name tests (#815) * Streamlined two very similar large column name tests * Added random number of test table names to avoid operand clash issues * Replaced to with for based on review * Changelog updated * changelog updated, test skipif changed to run on unix platforms * Fixed skipif typo * Fixed typo in skipif for pdo * Fixed some output for Travis * Moved error checking inside pdo connres tests * Added links back to changelog * Fixed output for sqlsrv connres tests * Fixed output * Fixed output again
2018-07-21 03:24:48 +03:00
- ps: (new-object net.webclient).DownloadFile('https://download.microsoft.com/download/E/6/B/E6BFDC7A-5BCD-4C51-9912-635646DA801E/en-US/msodbcsql_17.2.0.1_x64.msi', 'c:\projects\msodbcsql_17.2.0.1_x64.msi')
- cmd /c start /wait msiexec /i "c:\projects\msodbcsql_17.2.0.1_x64.msi" /q IACCEPTMSODBCSQLLICENSETERMS=YES ADDLOCAL=ALL
- echo Checking the version of MSODBCSQL
- reg query "HKLM\SOFTWARE\ODBC\odbcinst.ini\ODBC Driver 17 for SQL Server"
- dir %WINDIR%\System32\msodbcsql*.dll
- cd c:\projects
2017-01-11 00:59:16 +03:00
- echo update SQL connection string
- ps: (Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc) | ForEach-Object { $_ -replace "TARGET_SERVER", ${env:TEST_PHP_SQL_SERVER} -replace "TARGET_DATABASE", ${env:PDOSQLSRV_DBNAME} -replace "TARGET_USERNAME", ${env:TEST_PHP_SQL_UID} -replace "TARGET_PASSWORD", ${env:TEST_PHP_SQL_PWD} } | Set-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc
- ps: Select-String ${env:SQL_INSTANCE} ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc
- ps: Select-String ${env:PDOSQLSRV_DBNAME} ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc
- ps: (Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc) | ForEach-Object { $_ -replace "TARGET_SERVER", ${env:TEST_PHP_SQL_SERVER} -replace "TARGET_DATABASE", ${env:SQLSRV_DBNAME} -replace "TARGET_USERNAME", ${env:TEST_PHP_SQL_UID} -replace "TARGET_PASSWORD", ${env:TEST_PHP_SQL_PWD} } | Set-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc
- ps: Select-String ${env:SQL_INSTANCE} ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc
- ps: Select-String ${env:SQLSRV_DBNAME} ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc
- echo install opencppcoverage
2017-11-17 00:12:50 +03:00
- choco install opencppcoverage
- set path=C:\Program Files\OpenCppCoverage;%PYTHON%;%PYTHON%\Scripts;%path%
2017-01-11 00:59:16 +03:00
build_script:
- copy %APPVEYOR_BUILD_FOLDER%\buildscripts\*.py c:\projects
- cd c:\projects
- python -V
2018-04-23 19:05:21 +03:00
- python builddrivers.py --PHPVER=%PHP_VERSION% --ARCH=%BUILD_PLATFORM% --THREAD=%THREAD% --SOURCE=%APPVEYOR_BUILD_FOLDER%\source --TESTING --NO_RENAME
- cd c:\projects\php-sdk\phpdev\vc%PHP_VC%\%BUILD_PLATFORM%\php-%PHP_VERSION%-src\
- set PHP_SRC_DIR=%CD%\ext
- cd %PHP_EXE_PATH%
- set PHP_EXE_PATH=%CD%
2018-04-24 06:08:38 +03:00
- echo Showing the last few lines of php.ini
- ps: Get-Content ${env:PHP_EXE_PATH}\php.ini -Tail 5
- php --ini
- php -m
2017-01-11 00:59:16 +03:00
test_script:
2017-05-09 22:59:31 +03:00
- Echo setup test database for SQLSRV tests - %SQLSRV_DBNAME%
2017-06-24 02:08:54 +03:00
- python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\setup_dbs.py -dbname %SQLSRV_DBNAME%
2017-05-09 22:59:31 +03:00
- Echo setup test database for PDO_SQLSRV tests - %PDOSQLSRV_DBNAME%
2017-06-24 02:08:54 +03:00
- python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\setup_dbs.py -dbname %PDOSQLSRV_DBNAME%
2017-11-22 20:20:42 +03:00
- ps: >-
If ($env:BUILD_PLATFORM -Match "x86") {
2017-11-22 20:20:42 +03:00
Write-Host "Running phpt tests via OpenCppCoverage..."
2018-04-24 05:07:44 +03:00
OpenCppCoverage.exe --sources ${env:PHP_SRC_DIR}\*sqlsrv --modules ${env:PHP_EXE_PATH}\php*sqlsrv.dll --export_type=cobertura:c:\projects\coverage.xml --quiet --cover_children --continue_after_cpp_exception --optimized_build -- .\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\ | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -encoding UTF8;
Write-Host "Showing the last 25 lines of the log file..."
Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\tests.log -Tail 25;
2017-11-22 20:20:42 +03:00
ls *.xml
} Else {
Write-Host "Running phpt tests the regular way..."
.\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\*.phpt | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log -encoding UTF8;
Write-Host "Showing the last 25 lines of the log file..."
Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv.log -Tail 25;
.\php.exe run-tests.php -P ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\*.phpt | out-file -filePath ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log -encoding UTF8;
Write-Host "Showing the last 25 lines of the log file..."
Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv.log -Tail 25;
2017-11-22 20:20:42 +03:00
}
2017-11-23 01:14:34 +03:00
- python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %SQLSRV_DBNAME%
2017-06-24 02:08:54 +03:00
- python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %PDOSQLSRV_DBNAME%
- cd %PHP_EXE_PATH%
2018-04-24 05:07:44 +03:00
- ps: $fileExists = Test-Path "c:\projects\coverage.xml"
2017-11-17 20:32:56 +03:00
- ps: >-
If ($fileExists -eq $true) {
2018-04-24 05:07:44 +03:00
cd c:\projects
Write-Host "Running coverage analysis...";
2018-04-24 00:54:26 +03:00
Write-Host "Showing the packages...";
Select-String package .\coverage.xml;
2017-11-17 23:47:56 +03:00
Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh
2018-04-24 06:08:38 +03:00
bash codecov.sh -f "coverage.xml"
2018-04-24 05:07:44 +03:00
cd ${env:PHP_EXE_PATH}
2017-11-17 20:32:56 +03:00
}
2017-01-11 00:59:16 +03:00
after_test:
- cd %APPVEYOR_BUILD_FOLDER%\test\functional\
2017-11-18 22:03:23 +03:00
- ps: ls *.log
- python output.py
- ps: $difffiles = Get-ChildItem sqlsrv\*.diff
- ps: $outfiles = Get-ChildItem sqlsrv\*.out
- ps: foreach($file in $difffiles){ls $file; more $file}
- ps: foreach($file in $outfiles){ls $file; more $file}
2017-11-18 22:03:23 +03:00
- ps: $diff2files = Get-ChildItem pdo_sqlsrv\*.diff
- ps: $out2files = Get-ChildItem pdo_sqlsrv\*.out
- ps: foreach($file in $diff2files){ls $file; more $file}
- ps: foreach($file in $out2files){ls $file; more $file}
- cd %APPVEYOR_BUILD_FOLDER%\test\functional\
2017-11-21 21:03:33 +03:00
- ps: $xmlfiles = Get-ChildItem *.xml
- ps: foreach($file in $xmlfiles){(new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $file))}
- ps: >-
2017-11-18 22:03:23 +03:00
If ($difffiles -ne $null -Or $diff2files -ne $null) {
2017-11-18 21:43:34 +03:00
$host.SetShouldExit(1);
Write-Host "Forcing build failure due to phpt unit test failure(s)";
}