-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2617 from photodude/patch-2
Testing of MSSQL on Windows with AppVeyor
- Loading branch information
Showing
13 changed files
with
343 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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,108 @@ | ||
build: false | ||
platform: | ||
- x64 | ||
#matrix: | ||
# fast_finish: true # kills the build at the first failure | ||
clone_folder: C:\projects\dbal | ||
clone_depth: 1 | ||
|
||
cache: | ||
- C:\ProgramData\chocolatey\bin -> .appveyor.yml | ||
- C:\ProgramData\chocolatey\lib -> .appveyor.yml | ||
- c:\tools\php -> .appveyor.yml | ||
- composer.phar | ||
- '%LOCALAPPDATA%\Composer\files' | ||
#- vendor | ||
|
||
## Build matrix for lowest and highest possible targets | ||
environment: | ||
matrix: | ||
- db: mssql | ||
driver: sqlsrv | ||
db_version: sql2008r2sp2 | ||
php: 7.1 | ||
- db: mssql | ||
driver: sqlsrv | ||
db_version: sql2012sp1 | ||
php: 7.1 | ||
- db: mssql | ||
driver: sqlsrv | ||
db_version: sql2017 | ||
php: 7.1 | ||
- db: mssql | ||
driver: pdo_sqlsrv | ||
db_version: sql2017 | ||
php: 7.1 | ||
|
||
init: | ||
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH% | ||
- SET COMPOSER_NO_INTERACTION=1 | ||
- SET ANSICON=121x90 (121x90) | ||
|
||
## Install PHP and composer, and run the appropriate composer command | ||
install: | ||
- ps: | | ||
# Check if installation is cached | ||
if (!(Test-Path c:\tools\php)) { | ||
appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','') | ||
# install sqlite | ||
appveyor-retry cinst -y sqlite | ||
Get-ChildItem -Path c:\tools\php | ||
cd c:\tools\php | ||
# Set PHP environment items that are always needed | ||
copy php.ini-production php.ini | ||
Add-Content php.ini "`n date.timezone=UTC" | ||
Add-Content php.ini "`n extension_dir=ext" | ||
Add-Content php.ini "`n extension=php_openssl.dll" | ||
Add-Content php.ini "`n extension=php_mbstring.dll" | ||
Add-Content php.ini "`n extension=php_fileinfo.dll" | ||
Add-Content php.ini "`n extension=php_pdo_sqlite.dll" | ||
Add-Content php.ini "`n extension=php_sqlite3.dll" | ||
# If needed get the MSSQL DLL's | ||
if ($env:db -eq "mssql") { | ||
$DLLVersion = "5.2.0rc1" | ||
cd c:\tools\php\ext | ||
$source = "https://windows.php.net/downloads/pecl/releases/sqlsrv/$($DLLVersion)/php_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc14-x64.zip" | ||
$destination = "c:\tools\php\ext\php_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc14-x64.zip" | ||
Invoke-WebRequest $source -OutFile $destination | ||
7z x -y php_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc14-x64.zip > $null | ||
$source = "https://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($DLLVersion)/php_pdo_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc14-x64.zip" | ||
$destination = "c:\tools\php\ext\php_pdo_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc14-x64.zip" | ||
Invoke-WebRequest $source -OutFile $destination | ||
7z x -y php_pdo_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc14-x64.zip > $null | ||
Remove-Item c:\tools\php\* -include .zip | ||
cd c:\tools\php | ||
Add-Content php.ini "`nextension=php_sqlsrv.dll" | ||
Add-Content php.ini "`nextension=php_pdo_sqlsrv.dll" | ||
Add-Content php.ini "`n" | ||
} | ||
cd c:\projects\dbal | ||
if (!(Test-Path c:\projects\dbal\composer.phar)) { | ||
appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar | ||
} | ||
} | ||
# install composer dependencies | ||
- appveyor-retry php composer.phar self-update | ||
- appveyor-retry php composer.phar install --no-progress --profile | ||
|
||
before_test: | ||
# Selectively start the services | ||
- ps: >- | ||
if ($env:db -eq "mssql") { | ||
$instanceName = $env:db_version.ToUpper() | ||
Start-Service "MSSQL`$$instanceName" | ||
} | ||
test_script: | ||
- cd C:\projects\dbal | ||
- ps: >- | ||
if ($env:db_version) { | ||
vendor\bin\phpunit -c tests\appveyor\%db%.%db_version%.%driver%.appveyor.xml | ||
} | ||
else { | ||
vendor\bin\phpunit -c tests\appveyor\%db%.%driver%.appveyor.xml | ||
} |
This file contains 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 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 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 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 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 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
Oops, something went wrong.