Skip to content

Commit 242cdc0

Browse files
authored
Merge pull request #101 from peetw/dotnet-appveyor-config
Update AppVeyor CI config for new VS 2017 solution
2 parents caf7eeb + 7c20f13 commit 242cdc0

File tree

1 file changed

+37
-27
lines changed

1 file changed

+37
-27
lines changed

appveyor.yml

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,25 @@
22
# environment configuration #
33
#---------------------------------#
44

5+
# Build worker image (VM template)
6+
image: Visual Studio 2017
7+
58
# scripts that run after cloning repository
69
install:
10+
# install SQL Server 2008 R2 SP2 Express (not included in VS 2017 image; see: https://www.appveyor.com/docs/build-environment/#databases)
11+
- curl -L -O -S -s https://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLEXPR_x64_ENU.exe
12+
- 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"
13+
14+
# install SQL Server 2012 SP1 Express (not included in VS 2017 image; see: https://www.appveyor.com/docs/build-environment/#databases)
15+
- curl -L -O -S -s https://download.microsoft.com/download/5/2/9/529FEF7B-2EFB-439E-A2D1-A1533227CD69/SQLEXPR_x64_ENU.exe
16+
- 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"
17+
18+
# enable dynamic TCP ports for 2008 and 2012 SQL Server instances (so they can be run simultaneously)
19+
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0'
20+
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value ''
21+
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0'
22+
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value ''
23+
724
# install MySQL 5.6
825
# - curl -L -O -S -s https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-web-community-5.6.36.0.msi
926
# - msiexec /i mysql-installer-web-community-5.6.36.0.msi /quiet
@@ -32,16 +49,8 @@ install:
3249
- 7z x postgis-bundle-pg96-2.3.2x64.zip > nul
3350
- xcopy /s /y /q postgis-bundle-pg96-2.3.2x64 "C:\Program Files\PostgreSQL\9.6"
3451

35-
# enable dynamic TCP ports for 2008 and 2012 SQL Server instances (so they can be run simultaneously)
36-
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0'
37-
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value ''
38-
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0'
39-
- ps: set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value ''
40-
4152
# start services required for build/tests
4253
services:
43-
- mssql2008r2sp2 # start SQL Server 2008 R2 SP2 Express
44-
- mssql2012sp1 # start SQL Server 2012 Express
4554
# - mysql56 # start MySQL 5.6
4655
# - mysql57 # start MySQL 5.7
4756
- postgresql96 # start PostgreSQL 9.6
@@ -50,9 +59,6 @@ services:
5059
# build configuration #
5160
#---------------------------------#
5261

53-
# build platform, i.e. x86, x64, Any CPU
54-
platform: Any CPU
55-
5662
# build configuration, i.e. Debug, Release, etc.
5763
configuration: Release
5864

@@ -62,26 +68,16 @@ build:
6268
project: NHibernate.Spatial.sln
6369
verbosity: minimal
6470

71+
# scripts to run before build
72+
before_build:
73+
- cmd: nuget restore
74+
- cmd: dotnet --version
75+
- cmd: dotnet restore --verbosity minimal
76+
6577
#---------------------------------#
6678
# tests configuration #
6779
#---------------------------------#
6880

69-
# only run each test assembly once
70-
# NOTE: Must explicitly specify which assemblies to test, otherwise AppVeyor will default to Auto mode, which will recursively
71-
# scan the project folder for any test assembly (see: https://www.appveyor.com/docs/running-tests)
72-
# Since the test projects reference each other, this will then result in the referenced DLLs being "discovered" and run
73-
# multiple times (once in the original project's build folder and then again in each referencing project's build folder)
74-
test:
75-
assemblies:
76-
only:
77-
- Tests.NHibernate.Spatial.MsSql2008\bin\Release\Tests.NHibernate.Spatial.MsSql2008.dll
78-
- Tests.NHibernate.Spatial.MsSql2012\bin\Release\Tests.NHibernate.Spatial.MsSql2012.dll
79-
# Disable MySQL tests until issue #87 is resolved
80-
# - Tests.NHibernate.Spatial.MySQL\bin\Release\Tests.NHibernate.Spatial.MySQL.dll
81-
# - Tests.NHibernate.Spatial.MySQL57\bin\Release\Tests.NHibernate.Spatial.MySQL57.dll
82-
- Tests.NHibernate.Spatial.PostGis\bin\Release\Tests.NHibernate.Spatial.PostGis.dll
83-
- Tests.NHibernate.Spatial.PostGis20\bin\Release\Tests.NHibernate.Spatial.PostGis20.dll
84-
8581
# scripts to run before tests
8682
before_test:
8783
# setup SQL Server 2008
@@ -106,3 +102,17 @@ before_test:
106102
# setup PostgreSQL 9.6
107103
- SET psql="C:\Program Files\PostgreSQL\9.6\bin\psql.exe"
108104
- cmd /c "%psql% -q -p 5432 -U postgres -f Tests.NHibernate.Spatial.PostGis20\nhsp_test.sql"
105+
106+
test_script:
107+
- cmd: nunit3-console --config=Release --result=MsSql2008.xml;format=AppVeyor "Tests.NHibernate.Spatial.MsSql2008\Tests.NHibernate.Spatial.MsSql2008.csproj"
108+
- cmd: nunit3-console --config=Release --result=MsSql2012.xml;format=AppVeyor "Tests.NHibernate.Spatial.MsSql2012\Tests.NHibernate.Spatial.MsSql2012.csproj"
109+
# Disable MySQL tests until issue #87 is resolved
110+
# - cmd: dotnet test -c Release --no-build Tests.NHibernate.Spatial.MySQL
111+
# - cmd: dotnet test -c Release --no-build Tests.NHibernate.Spatial.MySQL57
112+
- cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=PostGis.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.PostGis
113+
- cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=PostGis20.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.PostGis20
114+
115+
after_test:
116+
- ps: $wc = New-Object 'System.Net.WebClient'
117+
- ps: $wc.UploadFile("https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)", (Resolve-Path PostGis.trx))
118+
- ps: $wc.UploadFile("https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)", (Resolve-Path PostGis20.trx))

0 commit comments

Comments
 (0)