-
Notifications
You must be signed in to change notification settings - Fork 117
/
Copy pathappveyor.yml.dnr
335 lines (207 loc) · 11.1 KB
/
appveyor.yml.dnr
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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
version: 5.2.0.{build}
branches:
except:
- gh-pages
configuration: Release
image: Visual Studio 2017
# platform: Any CPU
clone_folder: C:\projects\dotnet-standard-sdk
environment:
COVERALLS_REPO_TOKEN:
secure: Dnsrk2n+VNE4swcbTLXpfnHwUwTWT8TqMiMkthU6mq/ohNq9dA2rrSA6kdLDBKME #pragma: whitelist secret
WPS_GITHUB_TOKEN:
secure: t+mZcwVcfpNd/WhDqprKgG5TXWZLYQZ3SeEPjewueFBlvpMmUKnxoQsNmIii+5eu #pragma: whitelist secret
CRED_SECRET:
secure: eEcA/09B7XzeTSb3GlaeqcWfQ/TemXxAq9/0AFM5+z8= #pragma: whitelist secret
CREDENTIALS_GITHUB_TOKEN:
secure: J5kZIIRdDc9t2F9HtbURdy2kQlrGQoY1QiGTcuttxd8kbMqYqNLhUX3IvlysRcJo #pragma: whitelist secret
GITHUB_TOKEN:
secure: t+mZcwVcfpNd/WhDqprKgG5TXWZLYQZ3SeEPjewueFBlvpMmUKnxoQsNmIii+5eu #pragma: whitelist secret
IBM_CREDENTIALS_FILE: C:/projects/sdk-credentials/ibm-credentials.env
install:
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node 12.13.0
- cmd: >-
pip install git+git://github.com/smsearcy/bumpversion.git@issue-135
npm install semantic-release
npm install @semantic-release/exec
npm install @semantic-release/git
npm install @semantic-release/github
npm install @semantic-release/commit-analyzer
npm install @semantic-release/changelog
npm install @semantic-release/release-notes-generator
pip install bumpversion
rm -rf packages
mkdir packages
nuget restore
nuget install -Verbosity quiet -OutputDirectory packages -Version 4.7.922 OpenCover
nuget install -Verbosity quiet -OutputDirectory packages -Version 0.7.0 coveralls.net
nuget install -Verbosity quiet -OutputDirectory packages -Version 1.8.14 Doxygen
nuget install -Verbosity quiet -OutputDirectory packages secure-file -ExcludeVersion
before_build:
- ps: >-
if($env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)
{
git clone https://$env:[email protected]/germanatt/sdk-credentials.git C:/projects/sdk-credentials -q
}
dotnet restore
build:
project: IBM.Watson.sln
verbosity: minimal
after_build:
- ps: >-
git config --global user.email "[email protected]"
git config --global user.name "Watson Github Bot"
if(!$env:APPVEYOR_REPO_TAG_NAME)
{
$branchName = $env:APPVEYOR_REPO_BRANCH
}
else
{
$branchName = $env:APPVEYOR_REPO_TAG_NAME
}
Write-Output "branchName is " + $branchName
if($env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)
{
If($branchName -eq "development" -or $branchName -eq $env:APPVEYOR_REPO_TAG_NAME -or $branchName -eq "master")
{
.\packages\Doxygen.1.8.14\tools\doxygen.exe Doxyfile
git clone --quiet --branch=gh-pages https://$env:[email protected]/watson-developer-cloud/dotnet-standard-sdk.git gh-pages
If(Test-Path -Path gh-pages\docs\$branchName)
{
rm gh-pages\docs\$branchName -r -force
}
mkdir -p gh-pages\docs\$branchName
mv .\docs\html gh-pages\docs\$branchName
. .\.utility\generate_html.ps1
New-TableOfContents ".\gh-pages\docs" | Out-File ".\gh-pages\index.html" -encoding utf8
cd gh-pages
git add -f .
git commit -m "Updated documentation for $branchName"
git push -f origin gh-pages
cd ../
}
else
{
Write-Output "branchName is $branchName. Not generating documentation."
}
}
Copy-Item C:\projects\dotnet-standard-sdk\src\IBM.Watson.VisualRecognition.v3\Test\Integration\VisualRecognitionTestData C:\projects\dotnet-standard-sdk\VisualRecognitionTestData
Copy-Item C:\projects\dotnet-standard-sdk\src\IBM.Watson.VisualRecognition.v4\Test\Integration\VisualRecognitionTestData C:\projects\dotnet-standard-sdk\VisualRecognitionTestData
Copy-Item C:\projects\dotnet-standard-sdk\src\IBM.Watson.SpeechToText.v1\Test\Integration\SpeechToTextTestData C:\projects\dotnet-standard-sdk\SpeechToTextTestData
Copy-Item C:\projects\dotnet-standard-sdk\src\IBM.Watson.Discovery.v1\Test\Integration\DiscoveryTestData C:\projects\dotnet-standard-sdk\DiscoveryTestData
Copy-Item C:\projects\dotnet-standard-sdk\src\IBM.Watson.CompareComply.v1\Test\Integration\CompareComplyTestData C:\projects\dotnet-standard-sdk\CompareComplyTestData
Copy-Item C:\projects\dotnet-standard-sdk\src\IBM.Watson.NaturalLanguageClassifier.v1\Test\Integration\NaturalLanguageClassifierTestData C:\projects\dotnet-standard-sdk\NaturalLanguageClassifierTestData
test_script:
- ps: >-
if(Test-Path -Path coverage)
{
rm coverage -r -force
}
New-Item -path . -name coverage -itemtype directory
$testDirectories = "IBM.Watson.Assistant.v1", "IBM.Watson.Assistant.v2", "IBM.Watson.CompareComply.v1", "IBM.Watson.Discovery.v1",
"IBM.Watson.Discovery.v2", "IBM.Watson.LanguageTranslator.v3", "IBM.Watson.NaturalLanguageClassifier.v1",
"IBM.Watson.NaturalLanguageUnderstanding.v1", "IBM.Watson.PersonalityInsights.v3", "IBM.Watson.SpeechToText.v1",
"IBM.Watson.TextToSpeech.v1", "IBM.Watson.ToneAnalyzer.v3", "IBM.Watson.ToneAnalyzer.v3", "IBM.Watson.VisualRecognition.v4"
ForEach ($serviceDirectory in $testDirectories)
{
ForEach ($folder in (Get-ChildItem -Path C:\\projects\\dotnet-standard-sdk\\src\\$serviceDirectory\\Test -Directory))
{
if($env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)
{
Write-Output \"No pull request number. Executing tests\"
# dotnet test $serviceDirectory $folder.FullName
# if($LastExitCode -ne 0)
# {
# $host.SetShouldExit($LastExitCode )
# }
echo \"Test passed: $?\"
echo \"LastExitCode: $LastExitCode\"
$openCover = 'C:\\projects\\dotnet-standard-sdk\\packages\\OpenCover.4.7.922\\tools\\OpenCover.Console.exe'
$targetArgs = '-targetargs: test ' + $folder.FullName + ' -c Release -f netcoreapp2.0'
$filter = '-filter:+[IBM.Watson*]*-[*Tests*]*-[*Example*]*'
& $openCover '-target:C:\\Program Files\\dotnet\\dotnet.exe' $targetArgs '-register:user' $filter '-oldStyle' '-mergeoutput' '-hideskipped:File' '-searchdirs:$testdir\\bin\\release\\netcoreapp2.0' '-output:coverage\\coverage.xml'
if($env:COVERALLS_REPO_TOKEN)
{
C:\projects\dotnet-standard-sdk\packages\coveralls.net.0.7.0\tools\csmacnz.Coveralls.exe --opencover -i coverage\coverage.xml --useRelativePaths
}
else
{
Write-Output \"There is no Coveralls Repo Token - not pushing coverage.\"
}
}
else
{
Write-Output \"Pull request number is $env:APPVEYOR_PULL_REQUEST_NUMBER. Skipping integration tests.\"
if($folder.FullName.EndsWith("Unit"))
{
dotnet test $folder.FullName
if($LastExitCode -ne 0)
{
$host.SetShouldExit($LastExitCode )
}
echo \"Test passed: $?\"
echo \"LastExitCode: $LastExitCode\"
}
}
}
}
If($branchName -eq "master" -and $env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)
{
Write-Output "branchName is master and not a pull request - running semantic release"
npx -q semantic-release
}
ElseIf($branchName -eq $env:APPVEYOR_REPO_TAG_NAME)
{
Write-Output "branchName is " + $branchName + " - building NuGet packages"
dotnet pack .\src\IBM.Watson.Assistant.v1\IBM.Watson.Assistant.v1.csproj --configuration Release
dotnet pack .\src\IBM.Watson.Assistant.v2\IBM.Watson.Assistant.v2.csproj --configuration Release
dotnet pack .\src\IBM.Watson.CompareComply.v1\IBM.Watson.CompareComply.v1.csproj --configuration Release
dotnet pack .\src\IBM.Watson.Discovery.v1\IBM.Watson.Discovery.v1.csproj --configuration Release
dotnet pack .\src\IBM.Watson.Discovery.v2\IBM.Watson.Discovery.v2.csproj --configuration Release
dotnet pack .\src\IBM.Watson.LanguageTranslator.v3\IBM.Watson.LanguageTranslator.v3.csproj --configuration Release
dotnet pack .\src\IBM.Watson.NaturalLanguageClassifier.v1\IBM.Watson.NaturalLanguageClassifier.v1.csproj --configuration Release
dotnet pack .\src\IBM.Watson.NaturalLanguageUnderstanding.v1\IBM.Watson.NaturalLanguageUnderstanding.v1.csproj --configuration Release
dotnet pack .\src\IBM.Watson.PersonalityInsights.v3\IBM.Watson.PersonalityInsights.v3.csproj --configuration Release
dotnet pack .\src\IBM.Watson.SpeechToText.v1\IBM.Watson.SpeechToText.v1.csproj --configuration Release
dotnet pack .\src\IBM.Watson.TextToSpeech.v1\IBM.Watson.TextToSpeech.v1.csproj --configuration Release
dotnet pack .\src\IBM.Watson.ToneAnalyzer.v3\IBM.Watson.ToneAnalyzer.v3.csproj --configuration Release
dotnet pack .\src\IBM.Watson.VisualRecognition.v3\IBM.Watson.VisualRecognition.v3.csproj --configuration Release
dotnet pack .\src\IBM.Watson.VisualRecognition.v4\IBM.Watson.VisualRecognition.v4.csproj --configuration Release
}
artifacts:
- path: '\src\IBM.Watson.Assistant.v1\bin\$(configuration)\*.nupkg'
name: IBM.Watson.Assistant.v1
- path: '\src\IBM.Watson.Assistant.v2\bin\$(configuration)\*.nupkg'
name: IBM.Watson.Assistant.v2
- path: '\src\IBM.Watson.CompareComply.v1\bin\$(configuration)\*.nupkg'
name: IBM.Watson.CompareComply.v1
- path: '\src\IBM.Watson.Discovery.v1\bin\$(configuration)\*.nupkg'
name: IBM.Watson.Discovery.v1
- path: '\src\IBM.Watson.Discovery.v2\bin\$(configuration)\*.nupkg'
name: IBM.Watson.Discovery.v2
- path: '\src\IBM.Watson.LanguageTranslator.v3\bin\$(configuration)\*.nupkg'
name: IBM.Watson.LanguageTranslator.v3
- path: '\src\IBM.Watson.PersonalityInsights.v3\bin\$(configuration)\*.nupkg'
name: IBM.Watson.PersonalityInsights.v3
- path: '\src\IBM.Watson.SpeechToText.v1\bin\$(configuration)\*.nupkg'
name: IBM.Watson.SpeechToText.v1
- path: '\src\IBM.Watson.TextToSpeech.v1\bin\$(configuration)\*.nupkg'
name: IBM.Watson.TextToSpeech.v1
- path: '\src\IBM.Watson.ToneAnalyzer.v3\bin\$(configuration)\*.nupkg'
name: IBM.Watson.ToneAnalyzer.v3
- path: '\src\IBM.Watson.VisualRecognition.v3\bin\$(configuration)\*.nupkg'
name: IBM.Watson.VisualRecognition.v3
- path: '\src\IBM.Watson.VisualRecognition.v4\bin\$(configuration)\*.nupkg'
name: IBM.Watson.VisualRecognition.v4
- path: '\src\IBM.Watson.NaturalLanguageUnderstanding.v1\bin\$(configuration)\*.nupkg'
name: IBM.Watson.NaturalLanguageUnderstanding.v1
- path: '\src\IBM.Watson.NaturalLanguageClassifier.v1\bin\$(configuration)\*.nupkg'
name: IBM.Watson.NaturalLanguageClassifier.v1
deploy:
- provider: NuGet
api_key:
secure: 9rl2GRm8k9JdPuNNnFECkWxgbl/j5JDc3qajXawKvgnSbT7adY96jYFLynzITWjl
on:
branch: master
APPVEYOR_REPO_TAG: true