You are here

appveyor.yml in Drupal driver for SQL Server and SQL Azure 8.2

File

appveyor.yml
View source
  1. skip_tags: true
  2. init:
  3. - ps: ''
  4. services:
  5. - mssql2017
  6. - iis
  7. hosts:
  8. www.mydrupalsite.com: 127.0.0.1
  9. image:
  10. - Visual Studio 2019
  11. install:
  12. - ps: $Env:APPVEYOR_REPO_COMMIT_MESSAGE_FULL = "$env:APPVEYOR_REPO_COMMIT_MESSAGE $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED".TrimEnd();
  13. - ps: $Env:TestLogDir = "$Env:BuildDir\TestLogs";
  14. - ps: $Env:TestLogDirClone = "$Env:BuildDir\TestLogsClone";
  15. - cmd: mkdir %TestLogDir%
  16. - cmd: mkdir %TestLogDirClone%
  17. - ps: Start-Transcript -path "$Env:BuildDir\console.txt" -append
  18. - ps: $Env:APPVEYOR_REPO_COMMIT_MESSAGE_FULL = "$env:APPVEYOR_REPO_COMMIT_MESSAGE $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED".TrimEnd();
  19. - ps: Start-Service 'MSSQL$SQL2017' | out-null
  20. - ps: Set-Service 'SQLAgent$SQL2017' -StartupType Manual | out-null
  21. - ps: Start-Service W3SVC | out-null
  22. - ps: choco install php -y --no-progress 2>&1 > "$Env:TestLogDir\choco_install_php.txt"
  23. - ps: choco install urlrewrite -y --no-progress 2>&1 > "$Env:TestLogDir\choco_install_urlrewrite.txt"
  24. - ps: choco install OpenSSL.Light -y --no-progress 2>&1 > "$Env:TestLogDir\choco_install_openssl.txt"
  25. - ps: choco install sqlserver-odbcdriver -y --no-progress 2>&1 > "$Env:TestLogDir\choco_install_sqlserver-odbcdriver.txt"
  26. - ps: Install-Module PsIni
  27. - ps: |
  28. $WorkingDir = Convert-Path .
  29. $ZipPath = Join-Path $WorkingDir '\chef_cmdlet.zip'
  30. (New-Object Net.WebClient).DownloadFile('https://ci.appveyor.com/api/projects/David19767/iischef/artifacts/iischef.cmdlet.zip?branch=1.x', $ZipPath)
  31. $DESTINATION= Join-Path $env:ProgramFiles "\WindowsPowerShell\Modules\Chef"
  32. New-Item -ItemType directory -Force -Path $DESTINATION
  33. (new-object -com shell.application).namespace($DESTINATION).CopyHere((new-object -com shell.application).namespace($ZipPath).Items(),16)
  34. Remove-Item $ZipPath
  35. - ps: $Env:Path = "C:\Program Files\OpenSSL;" + $Env:Path;
  36. - cmd: sc config wuauserv start= auto
  37. - cmd: net start wuauserv
  38. - ps: (New-Object Net.WebClient).DownloadFile('http://curl.haxx.se/ca/cacert.pem', 'C:\tools\php74\cacert.pem')
  39. - ps: new-item c:\composer -itemtype directory
  40. - ps: $Env:Path = "C:\tools\php74;" + $Env:Path;
  41. - ps: $Env:Path = "C:\tools\php74;" + $Env:Path;
  42. - ps: Add-Content C:\tools\php74\php.ini "extension_dir=ext `n"
  43. - ps: Add-Content C:\tools\php74\php.ini "extension=php_openssl.dll `n"
  44. - ps: Add-Content C:\tools\php74\php.ini "extension=php_mbstring.dll `n"
  45. - ps: Add-Content C:\tools\php74\php.ini "extension=php_curl.dll `n"
  46. - ps: Add-Content C:\tools\php74\php.ini "extension=php_gd2.dll `n"
  47. - ps: Add-Content C:\tools\php74\php.ini "curl.cainfo=C:\tools\php74\cacert.pem `n"
  48. - ps: Add-Content C:\tools\php74\php.ini "openssl.cafile=C:\tools\php74\cacert.pem `n"
  49. - ps: Add-Content C:\tools\php74\php.ini "memory_limit=2048M `n"
  50. - ps: php -i | Out-File "$Env:TestLogDir\php-i.txt"
  51. - cmd: cd /d C:\composer
  52. # RDPFINISH
  53. - ps: |
  54. If ($Env:APPVEYOR_REPO_COMMIT_MESSAGE_FULL -imatch 'rdpcomposer') {
  55. $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
  56. }
  57. - cmd: choco install composer -y --no-progress
  58. - ps: Add-Content C:\ProgramData\ComposerSetup\bin\composer.bat ""
  59. - ps: refreshenv
  60. - cmd: SET PATH=C:\ProgramData\ComposerSetup\bin;%PATH%
  61. - ps: |
  62. If ($Env:APPVEYOR_REPO_COMMIT_MESSAGE_FULL -imatch 'rdpcomposer') {
  63. $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
  64. }
  65. - cmd: composer global require hirak/prestissimo
  66. - cmd: cd /d c:\projects
  67. - cmd: IF NOT EXIST C:\projects\drupal-project composer create-project -n drupal-composer/drupal-project:8.x-dev
  68. - cmd: cd /d C:\projects\drupal-project
  69. - cmd: composer config repositories.drupal composer https://packages.drupal.org/8
  70. - cmd: composer require drupal/sqlsrv:dev-2.x@dev
  71. # Replace the pulled module with the local files, only for this CI
  72. - cmd: xcopy /S /I /E /Y %APPVEYOR_BUILD_FOLDER% %cd%\web\modules\contrib\sqlsrv
  73. # Move the PHP_BIN needed to build the PHP environment
  74. - cmd: xcopy /S /I /E /Y %APPVEYOR_BUILD_FOLDER%\phpbin %cd%\phpbin
  75. # Copy driver
  76. - cmd: xcopy /S /I /E /Y %cd%\web\modules\contrib\sqlsrv\drivers %cd%\web\drivers
  77. - ps: |
  78. $cwd = (Get-Location).Path;
  79. "php $cwd\vendor\drupal\console\bin\drupal " + $([char]37) + "*" | Out-File $cwd/web/drupal.bat -Encoding ASCII
  80. - cmd: cd /d C:\projects\drupal-project\web
  81. - cmd: xcopy "%APPVEYOR_BUILD_FOLDER%\chef" "C:\projects\drupal-project\chef" /r /s /i
  82. - ps: Invoke-ChefSelfInstall -Path "c:\chef"
  83. - ps: Invoke-ChefAppDeployPath "C:\projects\drupal-project" drupal -Install
  84. - ps: $site = Invoke-ChefAppGetDeployment drupal
  85. - ps: $Env:DATABASENAME = $site.DeploymentActive.GetRuntimeSetting("services.default.database", "");
  86. - ps: $Env:DATABASEPASSWORD = $site.DeploymentActive.GetRuntimeSetting("services.default.password", "");
  87. - ps: $Env:DATABASEUSER = $site.DeploymentActive.GetRuntimeSetting("services.default.username", "");
  88. - ps: $Env:DATABASEHOST = $site.DeploymentActive.GetRuntimeSetting("services.default.host", "");
  89. - ps: $Env:SITERUNTIMEPATH = $site.DeploymentActive.runtimePath;
  90. # Make the site's PHP environment the default PHP environment
  91. - cmd: set path=%SITERUNTIMEPATH%\php;%path%
  92. - cmd: drupal about
  93. - ps: |
  94. If ($Env:APPVEYOR_REPO_COMMIT_MESSAGE_FULL -imatch 'rdpinstall') {
  95. $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
  96. }
  97. - cmd: drupal site:install standard --langcode="en" --db-type="sqlsrv" --db-host="localhost\SQL2017" --db-name="mydrupalsite" --db-user="sa" --db-pass="Password12!" --db-port="1433" --site-name="SQL Server Drupal Site" --site-mail="admin@example.com" --account-name="admin" --account-mail="admin@example.com" --account-pass="admin" --no-interaction
  98. - cmd: cd /d C:\projects\drupal-project
  99. - ps: $Env:CWD = (Get-Location).path;
  100. # - ps: (New-Object Net.WebClient).DownloadFile('https://www.drupal.org/files/issues/use_the_php_binary-2748883-15.patch',"$Env:CWD\patch.patch")
  101. # - cmd: git apply patch.patch --directory=web
  102. - cmd: cd /d C:\projects\drupal-project\web
  103. - cmd: drupal module:install simpletest
  104. - cmd: drupal module:install sqlsrv
  105. - ps: wget "http://sqlsrv.drupal.org/"
  106. build_script:
  107. - cmd: echo "No build"
  108. test_script:
  109. - cmd: cd /d C:\projects\drupal-project
  110. - cmd: mkdir %TestLogDir%\testresults\
  111. - cmd: echo Tests not run because they need to be updated as they are using deprecated implementations
  112. - ps: |
  113. php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Unit\OrderByTest 2>&1 > "$Env:TestLogDir\tests.log"
  114. if ($LASTEXITCODE -ne 0) {
  115. echo "($LASTEXITCODE) OrderByTest test failed."
  116. }
  117. php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Unit\SqlsrvConditionTest 2>&1 > "$Env:TestLogDir\tests.log"
  118. if ($LASTEXITCODE -ne 0) {
  119. echo "($LASTEXITCODE) SqlsrvConditionTest test failed."
  120. }
  121. php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Unit\SqlsrvConnectionTest 2>&1 > "$Env:TestLogDir\tests.log"
  122. if ($LASTEXITCODE -ne 0) {
  123. echo "($LASTEXITCODE) SqlsrvConnectionTest test failed."
  124. }
  125. php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\SchemaTest 2>&1 > "$Env:TestLogDir\tests.log"
  126. if ($LASTEXITCODE -ne 0) {
  127. echo "($LASTEXITCODE) SchemaTest test failed."
  128. }
  129. php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\SchemaTestExtended 2>&1 > "$Env:TestLogDir\tests.log"
  130. if ($LASTEXITCODE -ne 0) {
  131. echo "($LASTEXITCODE) SchemaTestExtended test failed."
  132. }
  133. php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\ConnectionTest 2>&1 > "$Env:TestLogDir\tests.log"
  134. if ($LASTEXITCODE -ne 0) {
  135. echo "($LASTEXITCODE) ConnectionTest test failed."
  136. }
  137. php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\SelectTest 2>&1 > "$Env:TestLogDir\tests.log"
  138. if ($LASTEXITCODE -ne 0) {
  139. echo "($LASTEXITCODE) SelectTest test failed."
  140. }
  141. php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\AliasTest 2>&1 > "$Env:TestLogDir\tests.log"
  142. if ($LASTEXITCODE -ne 0) {
  143. echo "($LASTEXITCODE) AliasTest test failed."
  144. }
  145. php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\ConditionTest 2>&1 > "$Env:TestLogDir\tests.log"
  146. if ($LASTEXITCODE -ne 0) {
  147. echo "($LASTEXITCODE) ConditionTest test failed."
  148. }
  149. php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\DeleteTruncateTest 2>&1 > "$Env:TestLogDir\tests.log"
  150. if ($LASTEXITCODE -ne 0) {
  151. echo "($LASTEXITCODE) DeleteTruncateTest test failed."
  152. }
  153. php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\MergeTest 2>&1 > "$Env:TestLogDir\tests.log"
  154. if ($LASTEXITCODE -ne 0) {
  155. echo "($LASTEXITCODE) MergeTest test failed."
  156. }
  157. php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\ParameterTest 2>&1 > "$Env:TestLogDir\tests.log"
  158. if ($LASTEXITCODE -ne 0) {
  159. echo "($LASTEXITCODE) ParameterTest test failed."
  160. }
  161. php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\SqlsrvTest 2>&1 > "$Env:TestLogDir\tests.log"
  162. if ($LASTEXITCODE -ne 0) {
  163. echo "($LASTEXITCODE) SqlsrvTest test failed."
  164. }
  165. php web/core/scripts/run-tests.sh --php php --verbose --url "http://sqlsrv.drupal.org/" --xml "$Env:TestLogDir\testresults\" "Common" --class Drupal\Tests\sqlsrv\Kernel\UpdateTest 2>&1 > "$Env:TestLogDir\tests.log"
  166. if ($LASTEXITCODE -ne 0) {
  167. echo "($LASTEXITCODE) UpdateTest test failed."
  168. }
  169. # After tests, try istalling all core modules\contrib\sqlsrv - cmd: drupal module:install simpletest
  170. on_finish:
  171. - ps: echo "on_finish start";
  172. - ps: Stop-Transcript
  173. - cmd: echo Build Version %APPVEYOR_BUILD_VERSION%
  174. # Add the chocolatey logs
  175. - cmd: mkdir %TestLogDir%\ChocolateyLogs
  176. - cmd: xcopy C:\ProgramData\chocolatey\logs %TestLogDir%\ChocolateyLogs /e /q & exit 0
  177. # Add the npm-cache logs
  178. - cmd: mkdir %TestLogDir%\npm-cache-logs
  179. - cmd: xcopy %APPDATA%\npm-cache\_logs %TestLogDir%\npm-cache-logs /s /q & exit 0
  180. # Zip and push test logs
  181. - cmd: xcopy %TestLogDir% %TestLogDirClone% /q /s /e & exit 0
  182. - cmd: 7z a -p"%APPVEYOR_BUILD_VERSION%" -r %BuildDir%\TestLogs.zip %TestLogDirClone%\* > null
  183. - ps: Push-AppveyorArtifact "$Env:BuildDir\TestLogs.zip" -FileName "TestLogs.zip"