forked from duplicati/duplicati
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
78 lines (68 loc) · 3.02 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
version: 1.0.{build}
image: Visual Studio 2017
configuration: Debug
platform: Any CPU
environment:
AUTOUPDATER_Duplicati_SKIP_UPDATE: 1
UNITTEST_BASEFOLDER: C:\projects\duplicati\testdata
COVERALLS_REPO_TOKEN:
secure: szQsrkP5rvra8L60SomD73/dFvRwot0UuyA566zqzI2qmLOr+MhLN0AyC8BTbhYY
before_build:
- cmd: nuget restore Duplicati.sln
build:
project: Duplicati.sln
verbosity: minimal
test_script:
- ps: |
Start-FileDownload https://s3.amazonaws.com/duplicati-test-file-hosting/DSMCBE.zip
7z x DSMCBE.zip -otestdata
mkdir .\testData\data
nuget install OpenCover -Version 4.6.166 -OutputDirectory packages
nuget install coveralls.net -Version 0.6.0 -OutputDirectory packages
nuget install NUnit.Runners -Version 3.4.0 -OutputDirectory packages
$testDir = ".\Duplicati\UnitTest\bin\Debug"
$tests = @("$testDir\Duplicati.UnitTest.dll")
$testsPassed = $true
foreach ($elem in $tests) {
$testResultsFile = "$elem" + ".xml"
.\packages\OpenCover.4.6.166\tools\OpenCover.Console.exe `
-register:user `
-target:.\packages\NUnit.ConsoleRunner.3.4.0\tools\nunit3-console.exe `
"-targetargs:""$elem"" /framework:net-4.5 /where:cat!=BulkData /result:""$testResultsFile""" `
"-filter:+[Duplicati.Library.Main]* -[UnitTest]*" `
-output:opencover.xml `
-returntargetcode `
# Keep track of test failures so that we can throw an exception after
# uploading coverage and test results.
$testsPassed = $testsPassed -and $?
# Upload test results to AppVeyor.
$wc = New-Object "System.Net.WebClient"
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\""$testResultsFile""))
}
if ($Env:COVERALLS_REPO_TOKEN) {
$revision = git rev-parse HEAD
$branch = git rev-parse --abbrev-ref HEAD
$commitAuthor = git show --quiet --format="%aN" $revision
$commitEmail = git show --quiet --format="%aE" $revision
$commitMessage = git show --quiet --format="%s" $revision
.\packages\coveralls.net.0.6.0\tools\csmacnz.Coveralls.exe `
--opencover -i opencover.xml `
--repoToken "$Env:COVERALLS_REPO_TOKEN" `
--commitId "$revision" `
--commitBranch "$branch" `
--commitAuthor "$commitAuthor" `
--commitEmail "$commitEmail" `
--commitMessage "$commitMessage" `
--useRelativePaths `
--basePath .\Duplicati\UnitTest\bin\Debug
}
if (!$testsPassed) {
throw "Tests failed."
}
notifications:
- provider: Webhook
url: https://webhooks.gitter.im/e/a2c55bac2b5c38838e0f
method: POST
on_build_success: true
on_build_failure: true
on_build_status_changed: true