forked from BenitoJedai/Bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
218 lines (168 loc) · 7.12 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# Notes:
# - Minimal appveyor.yml file is an empty file. All sections are optional.
# - Indent each level of configuration with 2 spaces. Do not use tabs!
# - All section names are case-sensitive.
# - Section names should be unique on each level.
#---------------------------------#
# general configuration #
#---------------------------------#
# version format
version: 17.10.1.{build}-{branch}
# branches to build
#branches:
# whitelist
# only:
# - temp
# blacklist
#except:
#- gh-pages
# Do not build on tags (GitHub only)
skip_tags: true
#---------------------------------#
# environment configuration #
#---------------------------------#
# Operating system (build VM template)
os: Visual Studio 2019
# scripts that are called at very beginning, before repo cloning
init:
- git config --global core.autocrlf input
# clone directory
clone_folder: c:\projects\Bridge
# fetch repository as zip archive
shallow_clone: true # default is "false"
# set clone depth
clone_depth: 30 # clone entire repository history if not defined
# environment variables
environment:
VisualStudioVersion: 12
# this is how to set encrypted variable. Go to "Encrypt data" page in account menu to encrypt data.
#my_secure_var1:
#secure: FW3tJ3fMncxvs58/ifSP7w==
# build cache to preserve files/folders between builds
cache:
- packages -> **\packages.config
# scripts that run after cloning repository
install:
# - ps: (New-Object Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe', 'c:\projects\Bridge\nuget\nuget.exe')
# - cmd: nuget sources add -Name NuGetV3 -Source https://api.nuget.org/v3/index.json
# - cmd: git.exe clone -q --progress -v --depth 20 --branch=master "https://github.com/bridgedotnet/Frameworks" "c:\projects\Frameworks"
# - cmd: git.exe clone -q --progress -v --depth 20 --branch=master "https://github.com/bridgedotnet/Testing" "c:\projects\Testing"
#---------------------------------#
# build configuration #
#---------------------------------#
# build platform, i.e. x86, x64, Any CPU. This setting is optional.
platform: Any CPU
# build Configuration, i.e. Debug, Release, etc.
configuration: Release
build:
# parallel: true # enable MSBuild parallel builds
project: c:\projects\Bridge\Bridge.sln # path to Visual Studio solution or project
# MSBuild verbosity level
verbosity: minimal
# scripts to run before build
before_build:
- appveyor-retry nuget restore "c:\projects\Bridge\.nuget\packages.config" -PackagesDirectory "c:\projects\Bridge\packages" -DisableParallelProcessing
- ps: >-
# Check if commit message contains labels [skip appveyor client] or [skip ci client] to skip client tests
IF ($env:SKIP_CLIENT_TESTS -eq $null) {
write-host "SETUP SKIP_CLIENT_TESTS is unset"
IF ($env:APPVEYOR_REPO_COMMIT_MESSAGE.ToLower().Contains("[skip appveyor client]")) {
write-host "SETUP Commit message contains [skip appveyor client]"
$env:SKIP_CLIENT_TESTS=$true
}
IF ($env:APPVEYOR_REPO_COMMIT_MESSAGE.ToLower().Contains("[skip ci client]")) {
write-host "SETUP Commit message contains [skip ci client]"
$env:SKIP_CLIENT_TESTS=$true
}
} ELSE {
write-host "SETUP SKIP_CLIENT_TESTS is set to $env:SKIP_CLIENT_TESTS"
}
IF ($env:SKIP_CLIENT_TESTS -eq $true) {
write-host "SETUP Will NOT run client tests as either the skipping labels found (either [skip appveyor client] or [skip ci client]) or set SKIP_CLIENT_TESTS=true"
} ELSE {
write-host "SETUP Will run client tests"
}
# Check if commit message contains labels [skip appveyor server] or [skip ci server] to skip server tests
IF ($env:SKIP_SERVER_TESTS -eq $null) {
write-host "SETUP SKIP_SERVER_TESTS is unset"
IF ($env:APPVEYOR_REPO_COMMIT_MESSAGE.ToLower().Contains("[skip appveyor server]")) {
write-host "SETUP Commit message contains [skip appveyor server]"
$env:SKIP_SERVER_TESTS=$true
}
IF ($env:APPVEYOR_REPO_COMMIT_MESSAGE.ToLower().Contains("[skip ci server]")) {
write-host "SETUP Commit message contains [skip ci server]"
$env:SKIP_SERVER_TESTS=$true
}
} ELSE {
write-host "SETUP SKIP_SERVER_TESTS is set to $env:SKIP_SERVER_TESTS"
}
IF ($env:SKIP_SERVER_TESTS -eq $true) {
write-host "SETUP Will NOT run server tests as either the skipping labels found (either [skip appveyor server] or [skip ci server]) or set SKIP_SERVER_TESTS=true"
} ELSE {
write-host "SETUP Will run server tests"
}
# scripts to run after build
after_build:
# to run your custom scripts instead of automatic MSBuild
build_script:
# to disable automatic builds
#build: off
# scripts to run before tests
before_test:
# - echo script1
- ps: >-
$env:CLIENT_TESTS_EXIT_CODE = 0
# scripts to run after tests
after_test:
# to run your custom scripts instead of automatic tests
test_script:
#- echo This is my custom test script
- ps: >-
IF ($env:SKIP_SERVER_TESTS -eq $true) {
write-host "Skipping server tests";
# This does not work see https://github.com/appveyor/ci/issues/1090
# So will use ELSE not exit
# $host.SetShouldExit(0); exit 0;
} ELSEIF ($env:CLIENT_TESTS_EXIT_CODE -ne 0) {
write-host "Skipping server tests as CLIENT_TESTS_EXIT_CODE = $env:CLIENT_TESTS_EXIT_CODE"
$host.SetShouldExit(1);
} ELSE {
nunit3-console "c:\projects\Bridge\Compiler\TranslatorTests\bin\Release\Bridge.Translator.Tests.dll"
}
# to disable automatic tests
# test:
# assemblies:
# - builder\translatortests\bin\$(configuration)\bridge.translator.tests.dll
# scripts to run before deployment
before_deploy:
# scripts to run after deployment
after_deploy:
# to run your custom scripts instead of provider deployments
deploy_script:
# to disable deployment
#deploy: off
#---------------------------------#
# global handlers #
#---------------------------------#
# on successful build
on_success:
# - do something
# on build failure
on_failure:
# - do something
# after build failure or success
on_finish:
- ps: $root = Resolve-Path Compiler\TranslatorTests; [IO.Directory]::GetFiles($root.Path, '*.log', 'AllDirectories') | % { Push-AppveyorArtifact $_ -FileName $_.Substring($root.Path.Length + 1) -DeploymentName TranslatorTestsLog }
# Uncomment the line below if you need Integration Test output
# - ps: $root = Resolve-Path Compiler\TranslatorTests\TestProjects\08\Bridge\output; [IO.Directory]::GetFiles($root.Path, '*.*', 'AllDirectories') | % { Push-AppveyorArtifact $_ -FileName $_.Substring($root.Path.Length + 1) -DeploymentName TranslatorTestsLog }
#---------------------------------#
# notifications #
#---------------------------------#
notifications:
- provider: Slack
auth_token:
secure: 2g1as+FdSYJM0dzLEBkosu66Q/9U8ncGWUd7IcAfWXViqG9X7eKMkOt3ai4JRcb+9k+2BW8Aewdt6tp3dOD27SB+rJZzoNeUjA1SCk8nbaM=
channel: '#bridge-meta'
on_build_status_changed: true
on_build_success: true
on_build_failure: true