forked from nhibernate/NHibernate.Spatial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
139 lines (114 loc) · 8.28 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
127
128
129
130
131
132
133
134
135
136
137
138
139
#---------------------------------#
# environment configuration #
#---------------------------------#
# Build worker image (VM template)
image:
- Visual Studio 2017
- Ubuntu
# 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)
- cmd: curl -L -O -S -s https://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLEXPR_x64_ENU.exe
- cmd: 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)
- cmd: curl -L -O -S -s https://download.microsoft.com/download/5/2/9/529FEF7B-2EFB-439E-A2D1-A1533227CD69/SQLEXPR_x64_ENU.exe
- cmd: 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)
- cmd: curl -L -O -S -s https://download.microsoft.com/download/4/B/1/4B1E9B0E-A4F3-4715-B417-31C82302A70A/ENU/x86/SQLSysClrTypes.msi
- cmd: SQLSysClrTypes.msi /passive
# enable dynamic TCP ports for 2008 and 2012 SQL Server instances (so they can be run simultaneously)
- ps: if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0' }
- ps: if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value '' }
- ps: if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0' }
- ps: if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value '' }
# install MySQL 5.6
# - cmd: curl -L -O -S -s https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-web-community-5.6.36.0.msi
# - cmd: msiexec /i mysql-installer-web-community-5.6.36.0.msi /quiet
# - cmd: "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: if ($isWindows) { $iniPath = 'C:\ProgramData\MySQL\MySQL Server 5.7\my.ini' }
# - ps: if ($isWindows) { (Get-Content $iniPath).replace('port=3306', 'port=3307') | Set-Content $iniPath }
# install PostgreSQL 8.4
- cmd: curl -L -O -S -s https://get.enterprisedb.com/postgresql/postgresql-8.4.22-1-windows.exe
- cmd: postgresql-8.4.22-1-windows.exe --mode unattended --superpassword Password12! --serverport 5431
# install PostGIS 1.5.5 for PostgreSQL 8.4
- cmd: curl -L -O -S -s http://download.osgeo.org/postgis/windows/pg84/postgis-pg84-binaries-1.5.5.zip
- cmd: 7z x postgis-pg84-binaries-1.5.5.zip > nul
- cmd: xcopy /s /y /q postgis-pg84-binaries-1.5.5 "C:\Program Files (x86)\PostgreSQL\8.4"
- cmd: SET PGPASSWORD=Password12!
- cmd: SET PGDIR=C:\Program Files (x86)\PostgreSQL\8.4
- cmd: SET PATH=%PGDIR%\bin;%PATH%
- cmd: createdb -p 5431 -U postgres template_postgis
- cmd: psql -q -p 5431 -U postgres -d template_postgis -f "%PGDIR%\share\contrib\postgis-1.5\postgis.sql"
- cmd: 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 on Windows
- cmd: curl -L -O -S -s http://download.osgeo.org/postgis/windows/pg96/archive/postgis-bundle-pg96-2.3.2x64.zip
- cmd: 7z x postgis-bundle-pg96-2.3.2x64.zip > nul
- cmd: xcopy /s /y /q postgis-bundle-pg96-2.3.2x64 "C:\Program Files\PostgreSQL\9.6"
# install PostgreSQL 9.6 and PostGIS 2.4 on Ubuntu
# note: PostGIS 2.3 not available in Ubuntu Bionic 18.04 repository
- sh: sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main"
- sh: wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
- sh: sudo apt-get update
- sh: sudo apt-get -y install postgresql-9.6 postgresql-9.6-postgis-2.4
- sh: sudo sed -i 's/port = [0-9]\+/port = 5432/' /etc/postgresql/9.6/main/postgresql.conf
#---------------------------------#
# 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:
- dotnet --version
- dotnet restore --verbosity minimal
#---------------------------------#
# tests configuration #
#---------------------------------#
# scripts to run before tests
before_test:
# setup SQL Server 2008
- cmd: sqlcmd -S (local)\SQL2008R2SP2 -i Tests.NHibernate.Spatial.MsSql2008\nhsp_test.sql
# setup SQL Server 2012
- cmd: sqlcmd -S (local)\SQL2012SP1 -i Tests.NHibernate.Spatial.MsSql2012\nhsp_test.sql
# setup MySQL 5.6
# - cmd: net start mysql56
# - cmd: SET MYSQL_PWD=Password12!
# - cmd: SET mysql="C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql.exe"
# - cmd: '%mysql% -P 3306 -u root < Tests.NHibernate.Spatial.MySQL\nhsp_test.sql'
# setup MySQL 5.7
# - cmd: net start mysql57
# - cmd: SET mysql="C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe"
# - cmd: '%mysql% -P 3307 -u root < Tests.NHibernate.Spatial.MySQL57\nhsp_test.sql'
# setup PostgreSQL 8.4
- cmd: SET psql="C:\Program Files (x86)\PostgreSQL\8.4\bin\psql.exe"
- cmd: '%psql% -q -p 5431 -U postgres -f Tests.NHibernate.Spatial.PostGis\nhsp_test.sql'
# setup PostgreSQL 9.6 on Windows
- cmd: net start postgresql-x64-9.6
- cmd: SET psql="C:\Program Files\PostgreSQL\9.6\bin\psql.exe"
- cmd: '%psql% -q -p 5432 -U postgres -f Tests.NHibernate.Spatial.PostGis20\nhsp_test.sql'
# setup PostgreSQL 9.6 on Ubuntu
# NOTE: Need to run psql command as postgres user to prevent peer authentication failure
- sh: sudo pg_ctlcluster 9.6 main start
- sh: sudo -u postgres 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
- ps: dotnet test -c Release --no-build --logger "trx;LogFileName=PostGis20.trx" --results-directory $env: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: if ($isWindows) { $wc.UploadFile($uri, (Resolve-Path MsSql2008.trx)) }
- ps: if ($isWindows) { $wc.UploadFile($uri, (Resolve-Path MsSql2012.trx)) }
# - ps: $wc.UploadFile($uri, (Resolve-Path MySQL.trx))
# - ps: $wc.UploadFile($uri, (Resolve-Path MySQL57.trx))
- ps: if ($isWindows) { $wc.UploadFile($uri, (Resolve-Path PostGis.trx)) }
- ps: $wc.UploadFile($uri, (Resolve-Path PostGis20.trx))