forked from microsoft/bond
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
243 lines (161 loc) · 7.66 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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# fsharp feature branch
-
version: 1.0.{build}
clone_depth: 15
branches:
only:
- fsharp
configuration: Debug
build:
project: fsharp\fsharp.sln
verbosity: minimal
test:
assemblies: fsharp\test\TypeProvider\bin\$(configuration)\BondFsharpUnitTest.dll
# other branches
-
version: 1.0.{build}
clone_depth: 15
environment:
BOND_TOKEN:
secure: 30K3L1s8erWFnnS/Iyb2LP7kiGZBr/GzA24Y82mCsGMBjzSUyk7uV7MvZ3NepNvB
matrix:
- BOND_BUILD: Doc
- BOND_BUILD: Python
BOND_VS: "Visual Studio 14 2015"
BOND_VS_NUM: 14
BOND_ARCH: 32
BOND_BOOST: 60
- BOND_BUILD: C++
BOND_VS: "Visual Studio 14 2015"
BOND_VS_NUM: 14
BOND_ARCH: 64
BOND_BOOST: 60
- BOND_BUILD: C#
BOND_OUTPUT: Properties
BOND_CONFIG: Debug
- BOND_BUILD: C++
BOND_VS: "Visual Studio 12 2013"
BOND_VS_NUM: 12
BOND_ARCH: 32
BOND_BOOST: 58
BOND_CMAKE_FLAGS: "-DBOND_CORE_ONLY=TRUE;-DBOND_SKIP_GBC_TESTS=TRUE"
- BOND_BUILD: C++
BOND_VS: "Visual Studio 12 2013"
BOND_VS_NUM: 12
BOND_ARCH: 64
BOND_BOOST: 58
BOND_CMAKE_FLAGS: "-DBOND_SKIP_CORE_TESTS=TRUE;-DBOND_SKIP_GBC_TESTS=TRUE"
- BOND_BUILD: C#
BOND_OUTPUT: Fields
BOND_CONFIG: Fields
- BOND_BUILD: "C# .NET Core"
BOND_CONFIG: Debug
install:
- ps: >-
git submodule update --init
if ($env:BOND_BOOST -eq 56) {
# Hard-coded Boost path per https://www.appveyor.com/docs/installed-software#languages-libraries-frameworks
$env:BOOST_ROOT = "C:/Libraries/boost"
$env:BOOST_LIBRARYDIR = "C:/Libraries/boost/lib${env:BOND_ARCH}-msvc-${env:BOND_VS_NUM}.0"
}
else {
$env:BOOST_ROOT = "C:/Libraries/boost_1_${env:BOND_BOOST}_0"
$env:BOOST_LIBRARYDIR = "C:/Libraries/boost_1_${env:BOND_BOOST}_0/lib${env:BOND_ARCH}-msvc-${env:BOND_VS_NUM}.0"
}
choco install haskellplatform -version 2014.2.0.0 -y
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine")
cabal update
if ($env:BOND_BUILD -eq "Doc") {
cabal install -j pandoc --constraint='mtl<=2.1.3.1'
choco install doxygen.install -y
}
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine")
cache:
- cs\packages -> cs\test\core\packages.config
- compiler\.cabal-sandbox -> compiler\bond.cabal
before_build:
- ps: >-
$env:PreferredToolArchitecture = "x64"
$env:_IsNativeEnvironment = "true"
$cmakeGenerator = $env:BOND_VS
if ($env:BOND_ARCH -eq 64) {
$cmakeGenerator += " Win64"
}
$cmakeFlags = $env:BOND_CMAKE_FLAGS -split ';'
if ($env:BOND_BUILD -eq "C#" -Or $env:BOND_BUILD -eq "C++") {
nuget restore cs\cs.sln
}
if ($env:BOND_BUILD -eq "Python") {
mkdir build
cd build
Wait-Process -name boost
cmake "-DBoost_ADDITIONAL_VERSIONS=1.${env:BOND_BOOST}.0" $cmakeFlags -G $cmakeGenerator ..
}
if ($env:BOND_BUILD -eq "C++") {
msbuild cs\cs.sln /verbosity:minimal /target:Tests\Compat /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
mkdir build
cd build
# Make sure we have Python27-64 before any other version; Python path per https://www.appveyor.com/docs/installed-software#python
if ($env:BOND_ARCH -eq 64) {
$env:Path = "C:\Python27-x64\scripts;C:\Python27-x64\;${env:Path}"
}
cmake $cmakeFlags -G $cmakeGenerator ..
}
if ($env:BOND_BUILD -eq "Doc") {
mkdir build
cd build
cmake ../doc
}
build_script:
- ps: >-
$env:PreferredToolArchitecture = "x64"
$env:_IsNativeEnvironment = "true"
if ($env:BOND_BUILD -eq "Doc") {
cmake --build . --target documentation -- /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
if ($? -And $env:BOND_TOKEN -And $env:APPVEYOR_REPO_BRANCH -eq "master") {
git config --global user.email "[email protected]"
git config --global user.name "Appveyor"
git clone -b gh-pages "https://${env:BOND_TOKEN}@github.com/Microsoft/bond.git" gh-pages 2>&1 | out-null
cd gh-pages
if (-not $?) { throw "Cloning gh-pages failed" }
Remove-Item * -Recurse
Copy-Item ..\html\* . -Recurse
git add --all .
git commit -m "Update documentation"
git push origin gh-pages 2>&1 | out-null
cd ..
}
}
if ($env:BOND_BUILD -eq "Python") {
cmake --build . --target python_unit_test -- /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
}
if ($env:BOND_BUILD -eq "C++") {
cmake --build . --target check -- /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
}
if ($env:BOND_BUILD -eq "C#") {
msbuild cs\cs.sln /verbosity:minimal /p:Configuration=${env:BOND_CONFIG} /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
}
if ($env:BOND_BUILD -eq "C# .NET Core") {
& cs\dnc\build.ps1 -Configuration $env:BOND_CONFIG -Verbosity minimal -MSBuildLogger "C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
}
if (-not $?) { throw "build failed" }
test_script:
- ps: >-
if ($env:BOND_BUILD -eq "Python") {
ctest -C Debug --tests-regex python_unit_test --output-on-failure
if (-not $?) { throw "tests failed" }
}
if ($env:BOND_BUILD -eq "C#") {
nunit-console-x86 /framework:net-4.0 /labels "cs\test\core\bin\debug\net40\${env:BOND_OUTPUT}\Bond.UnitTest.dll" cs\test\internal\bin\debug\net40\Bond.InternalTest.dll
if (-not $?) { throw "tests failed" }
nunit-console-x86 /framework:net-4.5 /labels "cs\test\core\bin\debug\net45\${env:BOND_OUTPUT}\Bond.UnitTest.dll" cs\test\internal\bin\debug\net45\Bond.InternalTest.dll
if (-not $?) { throw "tests failed" }
# We need to investigate why these tests are failing in AppVeyor, but not locally.
# nunit-console-x86 /framework:net-4.5 /labels "cs\test\comm\bin\debug\net45\${env:BOND_OUTPUT}\Bond.Comm.UnitTest.dll"
# if (-not $?) { throw "tests failed" }
}
if ($env:BOND_BUILD -eq "C# .NET Core") {
& cs\dnc\build.ps1 -Test -Configuration $env:BOND_CONFIG -Verbosity minimal -MSBuildLogger "C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
if (-not $?) { throw "tests failed" }
}
if (-not $?) { throw "build failed" }