1- # ---------------------------------#
2- # general configuration #
3- # ---------------------------------#
4-
51# version format
62version : 3.0.0.{build}
73
4+ matrix :
5+ fast_finish : true
6+
7+ # Build worker image (VM template)
8+ image :
9+ - Visual Studio 2022
10+
811# version suffix, if any (e.g. '-RC1', '-beta' otherwise '')
912environment :
1013 version_suffix : ' '
@@ -13,17 +16,19 @@ environment:
1316 # Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
1417 DOTNET_SKIP_FIRST_TIME_EXPERIENCE : true
1518
19+ pull_requests :
20+ do_not_increment_build_number : true
1621
1722# Do not build on tags (GitHub and BitBucket)
1823skip_tags : true
1924
20- # ---------------------------------#
21- # environment configuration #
22- # ---------------------------------#
23-
24- # Build worker image (VM template)
25- image :
26- - Visual Studio 2022
25+ # Build settings, not to be confused with "before_build" and "after_build".
26+ # "project" is relative to the original build directory and not influenced by directory changes in "before_build".
27+ build :
28+ # enable MSBuild parallel builds
29+ parallel : true
30+ # MSBuild verbosity level
31+ verbosity : minimal
2732
2833# enable patching of Directory.Build.props
2934dotnet_csproj :
@@ -32,28 +37,69 @@ dotnet_csproj:
3237 version : ' {version}'
3338 assembly_version : ' {version}'
3439 file_version : ' {version}'
35- informational_version : ' {version}$(version_suffix) '
40+ informational_version : ' {version}'
3641 package_version : ' {version}$(version_suffix)'
3742
3843# ---------------------------------#
3944# build configuration #
4045# ---------------------------------#
4146
47+ install :
48+ - ps : |
49+ # Install the required .NET SDK
50+ Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./dotnet-install.ps1"
51+ ./dotnet-install.ps1 -Channel LTS -InstallDir 'C:\Program Files\dotnet'
52+ # Remove the script so it doesn't "pollute" the build
53+ Remove-Item -Path .\dotnet-install.ps1
54+
4255build_script :
43- - ps : .\tools\Prepare-Release.ps1
56+ - ps : |
57+ dotnet restore --verbosity q --nologo /bl:.\artifacts\logs\restore.binlog
58+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
59+
60+ - ps : |
61+ dotnet build -c Release --verbosity q --nologo /bl:.\artifacts\logs\build.binlog
62+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
63+
64+ - ps : |
65+ dotnet publish --configuration Release --verbosity q -bl:.\artifacts\logs\publish.binlog
66+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
4467
4568# ---------------------------------#
4669# tests configuration #
4770# ---------------------------------#
4871
4972test_script :
50- - ps : .\tools\Run-Tests.ps1
73+ - ps : |
74+ dotnet test -c Release --no-restore --no-build --nologo --verbosity q --test-adapter-path:. --logger:Appveyor --logger:trx /bl:.\artifacts\logs\tests.binlog
75+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
5176
5277# ---------------------------------#
5378# artifacts configuration #
5479# ---------------------------------#
5580
5681artifacts :
57- - path : .\GitExtensions.PluginManager.*.zip
58- - path : .\GitExtensions.PluginManager.*.nupkg
59- - path : .\*.binlog
82+ - path : .\artifacts\GitExtensions.PluginManager.*.zip
83+ - path : .\artifacts\GitExtensions.PluginManager.*.nupkg
84+ - path : .\artifacts\logs\*.binlog
85+
86+
87+ # on build failure
88+ on_failure :
89+ - ps : |
90+ Get-ChildItem -recurse artifacts\Release\TestsResults\*.trx -ErrorAction SilentlyContinue `
91+ | ForEach-Object {
92+ Push-AppveyorArtifact "$_"
93+ }
94+ - ps : |
95+ Get-ChildItem -recurse artifacts\Release\TestsResults\*.trx | `
96+ ForEach-Object {
97+ $file = $_.FullName.Replace('[', '``[').Replace(']', '``]')
98+ #Write-Output "Processing $file"
99+
100+ [xml]$xml = Get-Content -Path $file
101+ $xml.TestRun.Results.UnitTestResult | Where-Object outcome -eq 'Failed' | ForEach-Object {
102+ $errorMessage = "$($_.Output.ErrorInfo.Message)`r`n$($_.Output.ErrorInfo.StackTrace)`r`n"
103+ Write-Host $errorMessage -ForegroundColor Red
104+ }
105+ }
0 commit comments