forked from stratisproject/StratisBitcoinFullNode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
104 lines (77 loc) · 3.06 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
# reference: https://www.appveyor.com/docs/appveyor-yml/
# you can use {branch} name in version format too
# version: 1.0.{build}-{branch}
version: 1.0.2.{build}
pull_requests:
do_not_increment_build_number: true
skip_tags: true
# branches to build
branches:
# whitelist
only:
- master
#---------------------------------#
# environment configuration #
#---------------------------------#
image: Visual Studio 2017
clone_folder: c:\projects\fullnode
configuration:
- Debug
- Release
# build cache to preserve files/folders between builds
cache:
- '%USERPROFILE%\.nuget\packages'
init:
- ps: dotnet --info
#---------------------------------#
# build configuration #
#---------------------------------#
build_script:
- ps: |
cd src
dotnet remove Stratis.Bitcoin/Stratis.Bitcoin.csproj package Tracer.Fody
Write-Host "[$env:configuration] STARTED dotnet build" -foregroundcolor "magenta"
dotnet build -c $env:configuration -v m
Write-Host "[$env:configuration] FINISHED dotnet build" -foregroundcolor "magenta"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
# scripts to run after build
after_build:
- ps: |
if($env:configuration -eq 'Release')
{
Write-Host "[$env:configuration] STARTED dotnet pack" -foregroundcolor "magenta"
cd Stratis.Bitcoin
dotnet pack -c $env:configuration -v m --no-build -o $env:APPVEYOR_BUILD_FOLDER\nuget\
cd ../Stratis.Bitcoin.Api
dotnet pack -c $env:configuration -v m --no-build -o $env:APPVEYOR_BUILD_FOLDER\nuget\
cd ../Stratis.Bitcoin.Features.LightWallet
dotnet pack -c $env:configuration -v m --no-build -o $env:APPVEYOR_BUILD_FOLDER\nuget\
Write-Host "[$env:configuration] FINISHED dotnet pack" -foregroundcolor "magenta"
}
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
test_script:
- ps: |
Write-Host "[$env:configuration] STARTED dotnet test" -foregroundcolor "magenta"
cd $env:APPVEYOR_BUILD_FOLDER/src
$anyFailures = $FALSE;
foreach ($testFolder in ls *.Tests) {
# exclude integration tests
if ($testFolder -like '*Integration.Tests*' -Or $testFolder -like '*IntegrationTests*') { continue }
Push-Location $testFolder
Write-Host "[$env:configuration] Running tests in $testFolder" -foregroundcolor "magenta"
dotnet test -c $env:configuration --no-build
if ($LastExitCode -ne 0) {
$anyFailures = $TRUE
Add-AppveyorMessage -Message "Some tests failed in $testFolder."
}
Pop-Location
}
Write-Host "[$env:configuration] FINISHED dotnet test" -foregroundcolor "magenta"
if ($anyFailures -eq $TRUE) { $host.SetShouldExit(1) }
#---------------------------------#
# artifacts configuration #
#---------------------------------#
# pushing all files in build directory recursively
artifacts:
- path: nuget\*.nupkg
name: nuget packages