7
7
- Visual Studio 2017
8
8
- Ubuntu
9
9
10
- # disable execution of PowerShell commands on Linux
11
- environment :
12
- APPVEYOR_YML_DISABLE_PS_LINUX : true
13
-
14
10
# scripts that run after cloning repository
15
11
install :
16
12
# install SQL Server 2008 R2 SP2 Express (not included in VS 2017 image; see: https://www.appveyor.com/docs/build-environment/#databases)
@@ -26,19 +22,19 @@ install:
26
22
- cmd : SQLSysClrTypes.msi /passive
27
23
28
24
# enable dynamic TCP ports for 2008 and 2012 SQL Server instances (so they can be run simultaneously)
29
- - ps : set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0'
30
- - ps : set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value ''
31
- - ps : set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0'
32
- - ps : set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value ''
25
+ - ps : if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0' }
26
+ - ps : if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value '' }
27
+ - ps : if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0' }
28
+ - ps : if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value '' }
33
29
34
30
# install MySQL 5.6
35
31
# - cmd: curl -L -O -S -s https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-web-community-5.6.36.0.msi
36
32
# - cmd: msiexec /i mysql-installer-web-community-5.6.36.0.msi /quiet
37
33
# - cmd: "C:\Program Files (x86)\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe" community install server;5.6.36;x64:*:port=3306;passwd=Password12! -silent
38
34
39
35
# change default port for MySQL 5.7 (so it can run simultaneously with MySQL 5.6)
40
- # - ps: $ iniPath = 'C:\ProgramData\MySQL\MySQL Server 5.7\my.ini'
41
- # - ps: ( Get-Content $iniPath).replace('port=3306', 'port=3307') | Set-Content $iniPath
36
+ # - ps: if ($isWindows) { $ iniPath = 'C:\ProgramData\MySQL\MySQL Server 5.7\my.ini' }
37
+ # - ps: if ($isWindows) { ( Get-Content $iniPath).replace('port=3306', 'port=3307') | Set-Content $iniPath }
42
38
43
39
# install PostgreSQL 8.4
44
40
- cmd : curl -L -O -S -s https://get.enterprisedb.com/postgresql/postgresql-8.4.22-1-windows.exe
@@ -55,11 +51,18 @@ install:
55
51
- cmd : psql -q -p 5431 -U postgres -d template_postgis -f "%PGDIR%\share\contrib\postgis-1.5\postgis.sql"
56
52
- cmd : psql -q -p 5431 -U postgres -d template_postgis -f "%PGDIR%\share\contrib\postgis-1.5\spatial_ref_sys.sql"
57
53
58
- # install PostGIS 2.3.2 for PostgreSQL 9.6
54
+ # install PostGIS 2.3.2 for PostgreSQL 9.6 on Windows
59
55
- cmd : curl -L -O -S -s http://download.osgeo.org/postgis/windows/pg96/archive/postgis-bundle-pg96-2.3.2x64.zip
60
56
- cmd : 7z x postgis-bundle-pg96-2.3.2x64.zip > nul
61
57
- cmd : xcopy /s /y /q postgis-bundle-pg96-2.3.2x64 "C:\Program Files\PostgreSQL\9.6"
62
58
59
+ # install PostgreSQL 9.6 and PostGIS 2.3 on Ubuntu
60
+ - sh : sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main"
61
+ - sh : wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
62
+ - sh : sudo apt-get update
63
+ - sh : sudo apt-get -y install postgresql-9.6 postgresql-9.6-postgis-2.3
64
+ - sh : sudo sed -i 's/port = [0-9]\+/port = 5432/' /etc/postgresql/9.6/main/postgresql.conf
65
+
63
66
# start services required for build/tests
64
67
# NOTE: Services are now started in "before_test" section as services are not available on Ubuntu image
65
68
# services:
@@ -112,26 +115,31 @@ before_test:
112
115
- cmd : SET psql="C:\Program Files (x86)\PostgreSQL\8.4\bin\psql.exe"
113
116
- cmd : ' %psql% -q -p 5431 -U postgres -f Tests.NHibernate.Spatial.PostGis\nhsp_test.sql'
114
117
115
- # setup PostgreSQL 9.6
118
+ # setup PostgreSQL 9.6 on Windows
116
119
- cmd : net start postgresql-x64-9.6
117
120
- cmd : SET psql="C:\Program Files\PostgreSQL\9.6\bin\psql.exe"
118
121
- cmd : ' %psql% -q -p 5432 -U postgres -f Tests.NHibernate.Spatial.PostGis20\nhsp_test.sql'
119
122
123
+ # setup PostgreSQL 9.6 on Ubuntu
124
+ # NOTE: Need to run psql command as postgres user to prevent peer authentication failure
125
+ - sh : sudo pg_ctlcluster 9.6 main start
126
+ - sh : sudo -u postgres psql -q -p 5432 -U postgres -f Tests.NHibernate.Spatial.PostGis20/nhsp_test.sql
127
+
120
128
test_script :
121
129
- cmd : dotnet test -c Release --no-build --logger "trx;LogFileName=MsSql2008.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.MsSql2008
122
130
- cmd : dotnet test -c Release --no-build --logger "trx;LogFileName=MsSql2012.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.MsSql2012
123
131
# Disable MySQL tests until issue #87 is resolved
124
132
# - cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=MySQL.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.MySQL
125
133
# - cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=MySQL57.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.MySQL57
126
134
- cmd : dotnet test -c Release --no-build --logger "trx;LogFileName=PostGis.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.PostGis
127
- - cmd : dotnet test -c Release --no-build --logger "trx;LogFileName=PostGis20.trx" --results-directory % APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.PostGis20
135
+ - ps : dotnet test -c Release --no-build --logger "trx;LogFileName=PostGis20.trx" --results-directory $env: APPVEYOR_BUILD_FOLDER Tests.NHibernate.Spatial.PostGis20
128
136
129
137
after_test :
130
138
- ps : $wc = New-Object 'System.Net.WebClient'
131
139
- ps : $uri = "https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)"
132
- - ps : $ wc.UploadFile($uri, (Resolve-Path MsSql2008.trx))
133
- - ps : $ wc.UploadFile($uri, (Resolve-Path MsSql2012.trx))
140
+ - ps : if ($isWindows) { $ wc.UploadFile($uri, (Resolve-Path MsSql2008.trx)) }
141
+ - ps : if ($isWindows) { $ wc.UploadFile($uri, (Resolve-Path MsSql2012.trx)) }
134
142
# - ps: $wc.UploadFile($uri, (Resolve-Path MySQL.trx))
135
143
# - ps: $wc.UploadFile($uri, (Resolve-Path MySQL57.trx))
136
- - ps : $ wc.UploadFile($uri, (Resolve-Path PostGis.trx))
144
+ - ps : if ($isWindows) { $ wc.UploadFile($uri, (Resolve-Path PostGis.trx)) }
137
145
- ps : $wc.UploadFile($uri, (Resolve-Path PostGis20.trx))
0 commit comments