Skip to content

Commit c2dffd6

Browse files
committed
Publish code coverage
1 parent 70d0c3b commit c2dffd6

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

appveyor.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ skip_tags: true
1010
clone_folder: C:\projects\libgit2sharp
1111

1212
environment:
13+
coveralls_token:
14+
secure: ixIsBslo9NheDb5lJknF58EYdgvZ0r3/L0ecRiXjfXmjHBLvoSU6/ZRwaMM+BAlG
1315
coverity_token:
1416
secure: nuzUT+HecXGIi3KaPd/1hgFEZJan/j6+oNbPV75JKjk=
1517
coverity_email:
@@ -66,6 +68,8 @@ install:
6668
If ($Env:SHOULD_PACKAGE_NUGET_ARTIFACT -eq $True)
6769
{
6870
cinst sourcelink -y
71+
nuget install OpenCover -Version 4.5.3723 -ExcludeVersion -OutputDirectory .\packages
72+
nuget install coveralls.net -Version 0.5.0 -ExcludeVersion -OutputDirectory .\packages
6973
}
7074
7175
If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $True)
@@ -98,7 +102,18 @@ test_script:
98102
- ps: |
99103
If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $False)
100104
{
101-
& "$Env:xunit_runner" "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor
105+
If ($Env:SHOULD_PACKAGE_NUGET_ARTIFACT -eq $True -and $Env:publish_on_success -eq $True)
106+
{
107+
.\packages\OpenCover\OpenCover.Console.exe `
108+
-register:user `
109+
-target:$Env:xunit_runner `
110+
"-targetargs:""$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll"" /noshadow /appveyor" `
111+
-filter:"+[LibGit2Sharp*]*" -output:opencoverCoverage.xml
112+
}
113+
Else
114+
{
115+
& "$Env:xunit_runner" "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor
116+
}
102117
}
103118
104119
after_test:
@@ -120,6 +135,16 @@ after_test:
120135
Write-Host "LibGit2Sharp version = $([LibGit2Sharp.GlobalSettings]::Version)" -ForegroundColor "Magenta"
121136
122137
Get-ChildItem "$Env:APPVEYOR_BUILD_FOLDER\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
138+
139+
.\packages\coveralls.net\csmacnz.Coveralls.exe `
140+
--opencover -i opencoverCoverage.xml `
141+
--repoToken $env:COVERALLS_REPO_TOKEN `
142+
--commitId $env:APPVEYOR_REPO_COMMIT `
143+
--commitBranch $env:APPVEYOR_REPO_BRANCH `
144+
--commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR `
145+
--commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL `
146+
--commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE `
147+
--jobId $env:APPVEYOR_JOB_ID
123148
}
124149
125150
If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $True -and $Env:publish_on_success -eq $True)

0 commit comments

Comments
 (0)