@@ -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,18 @@ 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*]*" -output:opencoverCoverage.xml
121
+ }
122
+ Else
123
+ {
124
+ & "$Env:xunit_runner" "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor
125
+ }
102
126
}
103
127
104
128
after_test :
@@ -122,6 +146,19 @@ after_test:
122
146
Get-ChildItem "$Env:APPVEYOR_BUILD_FOLDER\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
123
147
}
124
148
149
+ If ($Env:SHOULD_RUN_COVERALLS -eq $True -and $Env:publish_on_success -eq $True)
150
+ {
151
+ .\packages\coveralls.net\csmacnz.Coveralls.exe `
152
+ --opencover -i opencoverCoverage.xml `
153
+ --repoToken $env:COVERALLS_REPO_TOKEN `
154
+ --commitId $env:APPVEYOR_REPO_COMMIT `
155
+ --commitBranch $env:APPVEYOR_REPO_BRANCH `
156
+ --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR `
157
+ --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL `
158
+ --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE `
159
+ --jobId $env:APPVEYOR_JOB_ID
160
+ }
161
+
125
162
If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $True -and $Env:publish_on_success -eq $True)
126
163
{
127
164
7z a "$Env:APPVEYOR_BUILD_FOLDER\$Env:APPVEYOR_PROJECT_NAME.zip" "$Env:APPVEYOR_BUILD_FOLDER\cov-int\"
0 commit comments