-
Notifications
You must be signed in to change notification settings - Fork 33
/
appveyor.yml
105 lines (71 loc) · 3.34 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
version: 1.0.{build}
image: Visual Studio 2022
configuration: Release
init:
- cmd: ''
assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: '{version}'
assembly_file_version: '{version}'
assembly_informational_version: '{version}'
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: '{version}'
version_prefix: '{version}'
package_version: '{version}'
assembly_version: '{version}'
file_version: '{version}'
informational_version: '{version}'
environment:
NEventStore.MsSql: Server=localhost\SQL2017;Database=NEventStore;User Id=sa;Password=Password12!;
NEventStore.MySql: Server=localhost;Database=NEventStore;Uid=root;Pwd=Password12!;AutoEnlist=false;
NEventStore.PostgreSql: Server=localhost;Database=NEventStore;Uid=postgres;Pwd=Password12!;Enlist=false;
services:
- mssql2017
- mysql
- postgresql
install:
- cmd: >-
choco install gitversion.portable -pre -y
git submodule update --init --recursive
before_build:
- ps: >-
# Display .NET Core version
dotnet --version
# Display minimal restore text
dotnet restore ./src/NEventStore.Persistence.Sql.Core.sln --verbosity m
gitversion /l console /output buildserver /updateassemblyinfo
gitversion ".\dependencies\NEventStore" /updateassemblyinfo /l console
build:
project: src\NEventStore.Persistence.Sql.Core.sln
verbosity: minimal
after_build:
- cmd: >-
REM dotnet pack ./src/NEventStore.Persistence.Sql/NEventStore.Persistence.Sql.Core.csproj -c %CONFIGURATION% --no-build -o artifacts -p:PackageVersion=%GitVersion_NuGetVersion%
REM use .nuspec file, projects with submodule generate wrong PackageReferences
nuget pack ./src/.nuget/NEventStore.Persistence.Sql.nuspec -properties "version=%GitVersion_NuGetVersion%;configuration=%CONFIGURATION%" -OutputDirectory artifacts
test_script:
- ps: >-
$dbName = "NEventStore"
# Create MsSql database
$sqlInstance = "(local)\SQL2017"
sqlcmd -S "$sqlInstance" -Q "Use [master]; CREATE DATABASE [$dbName]"
# Create MySql database
$env:MYSQL_PWD="Password12!"
$mysqlcmd = '"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql" -e "create database $dbName;" --user=root'
iex "& $mysqlcmd"
# Create PostGRE Sql database
$env:PGUSER="postgres"
$env:PGPASSWORD="Password12!"
$pgcmd = '"C:\Program Files\PostgreSQL\9.6\bin\createdb" $dbName'
iex "& $pgcmd"
nunit3-console "C:\projects\neventstore-persistence-sql\src\NEventStore.Persistence.MsSql.Tests\bin\Release\net462\NEventStore.Persistence.MsSql.Tests.dll" "C:\projects\neventstore-persistence-sql\src\NEventStore.Persistence.MySql.Tests\bin\Release\net462\NEventStore.Persistence.MySql.Tests.dll" "C:\projects\neventstore-persistence-sql\src\NEventStore.Persistence.PostgreSql.Tests\bin\Release\net462\NEventStore.Persistence.PostgreSql.Tests.dll" "C:\projects\neventstore-persistence-sql\src\NEventStore.Persistence.Sqlite.Tests\bin\Release\net462\NEventStore.Persistence.Sqlite.Tests.dll" --workers=0 --result=testsresults.xml;
# upload results to AppVeyor
$wc = New-Object 'System.Net.WebClient'
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit3/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\testsresults.xml))
# todo: fix how dotnet tests are run
# dotnet test ./src/NEventStore.Persistence.Sql.Core.sln --no-build;
artifacts:
- path: '**\artifacts\**\*.*'