forked from nhibernate/NHibernate.Spatial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
126 lines (102 loc) · 7.29 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#---------------------------------#
# environment configuration #
#---------------------------------#
# Build worker image (VM template)
image: Visual Studio 2017
# scripts that run after cloning repository
install:
# install SQL Server 2008 R2 SP2 Express (not included in VS 2017 image; see: https://www.appveyor.com/docs/build-environment/#databases)
- curl -L -O -S -s https://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLEXPR_x64_ENU.exe
- SQLEXPR_x64_ENU.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=SQL2008R2SP2 /TCPENABLED=1 /SECURITYMODE=SQL /SAPWD=Password12! /ADDCURRENTUSERASSQLADMIN /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /AGTSVCACCOUNT="NT AUTHORITY\Network Service"
# install SQL Server 2012 SP1 Express (not included in VS 2017 image; see: https://www.appveyor.com/docs/build-environment/#databases)
- curl -L -O -S -s https://download.microsoft.com/download/5/2/9/529FEF7B-2EFB-439E-A2D1-A1533227CD69/SQLEXPR_x64_ENU.exe
- SQLEXPR_x64_ENU.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=SQL2012SP1 /TCPENABLED=1 /SECURITYMODE=SQL /SAPWD=Password12! /ADDCURRENTUSERASSQLADMIN /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /AGTSVCACCOUNT="NT AUTHORITY\Network Service"
# install x86 CLR types for SQL Server 2012 SP1 (required when running dotnet test for MsSql tests)
- curl -L -O -S -s https://download.microsoft.com/download/4/B/1/4B1E9B0E-A4F3-4715-B417-31C82302A70A/ENU/x86/SQLSysClrTypes.msi
- SQLSysClrTypes.msi /passive
# enable dynamic TCP ports for 2008 and 2012 SQL Server instances (so they can be run simultaneously)
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0'
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value ''
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0'
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value ''
# install MySQL 5.6
# - curl -L -O -S -s https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-web-community-5.6.36.0.msi
# - msiexec /i mysql-installer-web-community-5.6.36.0.msi /quiet
# - cmd /c ""C:\Program Files (x86)\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe" community install server;5.6.36;x64:*:port=3306;passwd=Password12! -silent"
# change default port for MySQL 5.7 (so it can run simultaneously with MySQL 5.6)
# - ps: $iniPath = 'C:\ProgramData\MySQL\MySQL Server 5.7\my.ini'
# - ps: (Get-Content $iniPath).replace('port=3306', 'port=3307') | Set-Content $iniPath
# install PostgreSQL 8.4
- curl -L -O -S -s https://get.enterprisedb.com/postgresql/postgresql-8.4.22-1-windows.exe
- postgresql-8.4.22-1-windows.exe --mode unattended --superpassword Password12! --serverport 5431
# install PostGIS 1.5.5 for PostgreSQL 8.4
- curl -L -O -S -s http://download.osgeo.org/postgis/windows/pg84/postgis-pg84-binaries-1.5.5.zip
- 7z x postgis-pg84-binaries-1.5.5.zip > nul
- xcopy /s /y /q postgis-pg84-binaries-1.5.5 "C:\Program Files (x86)\PostgreSQL\8.4"
- SET PGPASSWORD=Password12!
- SET PGDIR=C:\Program Files (x86)\PostgreSQL\8.4
- cmd /c ""%PGDIR%\bin\createdb" -p 5431 -U postgres template_postgis"
- cmd /c ""%PGDIR%\bin\psql" -q -p 5431 -U postgres -d template_postgis -f "%PGDIR%\share\contrib\postgis-1.5\postgis.sql""
- cmd /c ""%PGDIR%\bin\psql" -q -p 5431 -U postgres -d template_postgis -f "%PGDIR%\share\contrib\postgis-1.5\spatial_ref_sys.sql""
# install PostGIS 2.3.2 for PostgreSQL 9.6
- curl -L -O -S -s http://download.osgeo.org/postgis/windows/pg96/archive/postgis-bundle-pg96-2.3.2x64.zip
- 7z x postgis-bundle-pg96-2.3.2x64.zip > nul
- xcopy /s /y /q postgis-bundle-pg96-2.3.2x64 "C:\Program Files\PostgreSQL\9.6"
# start services required for build/tests
services:
# - mysql56 # start MySQL 5.6
# - mysql57 # start MySQL 5.7
- postgresql96 # start PostgreSQL 9.6
#---------------------------------#
# build configuration #
#---------------------------------#
# build configuration, i.e. Debug, Release, etc.
configuration: Release
# MSBuild options
build:
parallel: true
project: NHibernate.Spatial.sln
verbosity: minimal
# scripts to run before build
before_build:
- cmd: dotnet --version
- cmd: dotnet restore --verbosity minimal
#---------------------------------#
# tests configuration #
#---------------------------------#
# scripts to run before tests
before_test:
# setup SQL Server 2008
- sqlcmd -S (local)\SQL2008R2SP2 -i Tests.NHibernate.Spatial.MsSql2008\nhsp_test.sql
# setup SQL Server 2012
- sqlcmd -S (local)\SQL2012SP1 -i Tests.NHibernate.Spatial.MsSql2012\nhsp_test.sql
# setup MySQL 5.6
# - SET MYSQL_PWD=Password12!
# - SET mysql="C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql.exe"
# - cmd /c "%mysql% -P 3306 -u root < Tests.NHibernate.Spatial.MySQL\nhsp_test.sql"
# setup MySQL 5.7
# - SET mysql="C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe"
# - cmd /c "%mysql% -P 3307 -u root < Tests.NHibernate.Spatial.MySQL57\nhsp_test.sql"
# setup PostgreSQL 8.4
- SET psql="C:\Program Files (x86)\PostgreSQL\8.4\bin\psql.exe"
- cmd /c "%psql% -q -p 5431 -U postgres -f Tests.NHibernate.Spatial.PostGis\nhsp_test.sql"
# setup PostgreSQL 9.6
- SET psql="C:\Program Files\PostgreSQL\9.6\bin\psql.exe"
- cmd /c "%psql% -q -p 5432 -U postgres -f Tests.NHibernate.Spatial.PostGis20\nhsp_test.sql"
test_script:
- cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=MsSql2008.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.MsSql2008
- cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=MsSql2012.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.MsSql2012
# Disable MySQL tests until issue #87 is resolved
# - cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=MySQL.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.MySQL
# - cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=MySQL57.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.MySQL57
- cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=PostGis.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.PostGis
- cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=PostGis20.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.PostGis20
after_test:
- ps: $wc = New-Object 'System.Net.WebClient'
- ps: $uri = "https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)"
- ps: $wc.UploadFile($uri, (Resolve-Path MsSql2008.trx))
- ps: $wc.UploadFile($uri, (Resolve-Path MsSql2012.trx))
# - ps: $wc.UploadFile($uri, (Resolve-Path MySQL.trx))
# - ps: $wc.UploadFile($uri, (Resolve-Path MySQL57.trx))
- ps: $wc.UploadFile($uri, (Resolve-Path PostGis.trx))
- ps: $wc.UploadFile($uri, (Resolve-Path PostGis20.trx))