@@ -10,6 +10,8 @@ skip_tags: true
10
10
clone_folder : C:\projects\libgit2sharp
11
11
12
12
environment :
13
+ coveralls_token :
14
+ secure : ixIsBslo9NheDb5lJknF58EYdgvZ0r3/L0ecRiXjfXmjHBLvoSU6/ZRwaMM+BAlG
13
15
coverity_token :
14
16
secure : nuzUT+HecXGIi3KaPd/1hgFEZJan/j6+oNbPV75JKjk=
15
17
coverity_email :
@@ -60,6 +62,11 @@ install:
60
62
Write-Host "Should package Nuget artifact = " -NoNewLine
61
63
Write-Host $Env:SHOULD_PACKAGE_NUGET_ARTIFACT -ForegroundColor "Green"
62
64
65
+ $Env:SHOULD_RUN_COVERALLS = $($Env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null `
66
+ -and $Env:APPVEYOR_SCHEDULED_BUILD -eq $False)
67
+ Write-Host "Should run Coveralls = " -NoNewLine
68
+ Write-Host $Env:SHOULD_RUN_COVERALLS -ForegroundColor "Green"
69
+
63
70
Write-Host "Should publish on success = " -NoNewLine
64
71
Write-Host $Env:publish_on_success -ForegroundColor "Green"
65
72
@@ -68,6 +75,12 @@ install:
68
75
cinst sourcelink -y
69
76
}
70
77
78
+ If ($Env:SHOULD_RUN_COVERALLS -eq $True)
79
+ {
80
+ nuget install OpenCover -Version 4.5.3723 -ExcludeVersion -OutputDirectory .\packages
81
+ nuget install coveralls.net -Version 0.5.0 -ExcludeVersion -OutputDirectory .\packages
82
+ }
83
+
71
84
If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $True)
72
85
{
73
86
cinst curl -y
@@ -98,7 +111,20 @@ test_script:
98
111
- ps : |
99
112
If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $False)
100
113
{
101
- & "$Env:xunit_runner" "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor
114
+ If ($Env:SHOULD_RUN_COVERALLS -eq $True -and $Env:publish_on_success -eq $True)
115
+ {
116
+ .\packages\OpenCover\OpenCover.Console.exe `
117
+ -register:user `
118
+ -target:$Env:xunit_runner `
119
+ "-targetargs:""$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll"" /noshadow /appveyor" `
120
+ "-filter:+[LibGit2Sharp]* -[LibGit2Sharp.Tests]*" `
121
+ -hideskipped:All `
122
+ -output:opencoverCoverage.xml
123
+ }
124
+ Else
125
+ {
126
+ & "$Env:xunit_runner" "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor
127
+ }
102
128
}
103
129
104
130
after_test :
@@ -122,6 +148,23 @@ after_test:
122
148
Get-ChildItem "$Env:APPVEYOR_BUILD_FOLDER\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
123
149
}
124
150
151
+ If ($Env:SHOULD_RUN_COVERALLS -eq $True -and $Env:publish_on_success -eq $True)
152
+ {
153
+ Write-Host "Uploading code coverage result..." -ForegroundColor "Green"
154
+
155
+ .\packages\coveralls.net\csmacnz.Coveralls.exe `
156
+ --opencover -i opencoverCoverage.xml `
157
+ --repoToken $Env:coveralls_token `
158
+ --commitId $Env:APPVEYOR_REPO_COMMIT `
159
+ --commitBranch $Env:APPVEYOR_REPO_BRANCH `
160
+ --commitAuthor $Env:APPVEYOR_REPO_COMMIT_AUTHOR `
161
+ --commitEmail $Env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL `
162
+ --commitMessage $Env:APPVEYOR_REPO_COMMIT_MESSAGE `
163
+ --useRelativePaths `
164
+ --basePath "$Env:APPVEYOR_BUILD_FOLDER\"`
165
+ --jobId $Env:APPVEYOR_JOB_ID
166
+ }
167
+
125
168
If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $True -and $Env:publish_on_success -eq $True)
126
169
{
127
170
7z a "$Env:APPVEYOR_BUILD_FOLDER\$Env:APPVEYOR_PROJECT_NAME.zip" "$Env:APPVEYOR_BUILD_FOLDER\cov-int\"
0 commit comments