-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathappveyor.yml
102 lines (84 loc) · 3.42 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
# version format
version: 3.0.0.{build}
matrix:
fast_finish: true
# Build worker image (VM template)
image:
- Visual Studio 2022
# version suffix, if any (e.g. '-RC1', '-beta' otherwise '')
environment:
version_suffix: ''
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Do not build on tags (GitHub and BitBucket)
skip_tags: true
# Build settings, not to be confused with "before_build" and "after_build".
# "project" is relative to the original build directory and not influenced by directory changes in "before_build".
build:
# enable MSBuild parallel builds
parallel: true
# MSBuild verbosity level
verbosity: minimal
# enable patching of Directory.Build.props
dotnet_csproj:
patch: true
file: '**\*.props'
version: '{version}'
assembly_version: '{version}'
file_version: '{version}'
informational_version: '{version}$(version_suffix)'
package_version: '{version}$(version_suffix)'
#---------------------------------#
# build configuration #
#---------------------------------#
install:
- ps: |
# Install the required .NET SDK
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./dotnet-install.ps1"
./dotnet-install.ps1 -Channel LTS -InstallDir 'C:\Program Files\dotnet'
# Remove the script so it doesn't "pollute" the build
Remove-Item -Path .\dotnet-install.ps1
build_script:
- ps: |
dotnet restore --verbosity q --nologo /bl:.\artifacts\logs\restore.binlog
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
- ps: |
dotnet build -c Release --verbosity q --nologo /bl:.\artifacts\logs\build.binlog
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
- ps: |
dotnet publish --configuration Release --verbosity q -bl:.\artifacts\logs\publish.binlog
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
#---------------------------------#
# tests configuration #
#---------------------------------#
test_script:
- ps: |
dotnet test -c Release --no-restore --no-build --nologo --verbosity q --test-adapter-path:. --logger:Appveyor --logger:trx /bl:.\artifacts\logs\tests.binlog
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
#---------------------------------#
# artifacts configuration #
#---------------------------------#
artifacts:
- path: .\artifacts\GitExtensions.PluginManager.*.zip
- path: .\artifacts\GitExtensions.PluginManager.*.nupkg
- path: .\artifacts\logs\*.binlog
# on build failure
on_failure:
- ps: |
Get-ChildItem -recurse artifacts\Release\TestsResults\*.trx -ErrorAction SilentlyContinue `
| ForEach-Object {
Push-AppveyorArtifact "$_"
}
- ps: |
Get-ChildItem -recurse artifacts\Release\TestsResults\*.trx | `
ForEach-Object {
$file = $_.FullName.Replace('[', '``[').Replace(']', '``]')
#Write-Output "Processing $file"
[xml]$xml = Get-Content -Path $file
$xml.TestRun.Results.UnitTestResult | Where-Object outcome -eq 'Failed' | ForEach-Object {
$errorMessage = "$($_.Output.ErrorInfo.Message)`r`n$($_.Output.ErrorInfo.StackTrace)`r`n"
Write-Host $errorMessage -ForegroundColor Red
}
}