forked from KindDragon/ICSharpCode.TextEditor
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathappveyor.yml
66 lines (57 loc) · 2.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
version: 4.1.0.{build}
branches:
except:
- /experimental\/*/
matrix:
fast_finish: true
# https://www.appveyor.com/docs/build-environment/#build-worker-images
image: Visual Studio 2022
environment:
# 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
# Use latest version of current used .NET version. 6.0 could use the latest of 6.0. See .\Scripts\Update-DotnetVersion.ps1
GE_USE_LATEST_DOTNET: false
# 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
# to run your custom scripts instead of automatic MSBuild
build_script:
- 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
- ps: |
# build .NET
dotnet build -c Release --verbosity q --nologo /bl:.\build.binlog
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
# to run your custom scripts instead of automatic tests
test_script:
- ps: |
dotnet test -c Release --no-restore --nologo --verbosity q --test-adapter-path:. --logger:Appveyor --logger:trx /bl:.\tests.binlog
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
# on build failure
on_failure:
- ps: |
Get-ChildItem -recurse *.binlog -ErrorAction SilentlyContinue `
| ForEach-Object {
Push-AppveyorArtifact "$_"
}
- ps: |
Get-ChildItem -recurse Test\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
}
}