forked from gitextensions/gitextensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
95 lines (76 loc) · 2.92 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
version: 4.0.0.{build}
branches:
except:
- configdata
- gh-pages
- /experimental\/*/
matrix:
fast_finish: true
# https://www.appveyor.com/docs/build-environment/#build-worker-images
image: Visual Studio 2019
init:
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# 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
install:
- cmd: git submodule update --init --recursive
- cmd: echo /logger:"%ProgramFiles%\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll">> Directory.Build.rsp
- cmd: |-
cd scripts
C:\\Python35\\python set_version_to.py -v %APPVEYOR_BUILD_VERSION% -t %APPVEYOR_BUILD_VERSION%
cd ..
# to run your custom scripts instead of automatic MSBuild
build_script:
- ps: |
# for release branches mark the repo as clean
if (!$env:APPVEYOR_PULL_REQUEST_TITLE -and $env:APPVEYOR_REPO_BRANCH.StartsWith("release/")) {
& .\scripts\Mark-RepoClean.ps1
}
# build
& .\cibuild.cmd -restore -build -buildNative -loc
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
# to run your custom scripts instead of automatic tests
test_script:
- ps: |
& .\cibuild.cmd -test
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode); }
& .\cibuild.cmd -integrationTest
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
# scripts to run after tests
after_test:
- ps: |
Write-Host "Preparing build artifacts..."
& .\cibuild.cmd -publish
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
artifacts:
- path: artifacts\log\**\*.binlog
- path: artifacts\publish\*.zip
#on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# on build failure
on_failure:
- ps: |
Get-ChildItem -recurse artifacts\tests\TestResult.xml -ErrorAction SilentlyContinue `
| ForEach-Object {
$resultFilePath = "$_"
Get-Content $resultFilePath `
| Select-String -Pattern '<test-run id="[^"]*"\s+testcasecount="(\d+)"\s+result="([^"]*)"\s+total="(\d+)"\s+passed="(\d+)"\s+failed="(\d+)".*' `
| foreach {
$result = $_.Matches.Groups
$total = $result[1].Value
$passed = $result[4].Value
$failed = $result[5].Value
$notPassed = $total - $passed
$testErrors = $failed
$testProjectName = $resultFilePath.Split('\\')[-3]
if ($testErrors -ne 0) {
$logFile = Get-ChildItem -recurse artifacts\$testProjectName*.log
Push-AppveyorArtifact $logFile
}
}
}