Skip to content

Commit 4c35083

Browse files
committed
Publish code coverage
1 parent 9d3fe4d commit 4c35083

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

appveyor.yml

Lines changed: 38 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:
@@ -60,6 +62,11 @@ install:
6062
Write-Host "Should package Nuget artifact = " -NoNewLine
6163
Write-Host $Env:SHOULD_PACKAGE_NUGET_ARTIFACT -ForegroundColor "Green"
6264
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+
6370
Write-Host "Should publish on success = " -NoNewLine
6471
Write-Host $Env:publish_on_success -ForegroundColor "Green"
6572
@@ -68,6 +75,12 @@ install:
6875
cinst sourcelink -y
6976
}
7077
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+
7184
If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $True)
7285
{
7386
cinst curl -y
@@ -98,7 +111,18 @@ test_script:
98111
- ps: |
99112
If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $False)
100113
{
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+
}
102126
}
103127
104128
after_test:
@@ -122,6 +146,19 @@ after_test:
122146
Get-ChildItem "$Env:APPVEYOR_BUILD_FOLDER\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
123147
}
124148
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+
125162
If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $True -and $Env:publish_on_success -eq $True)
126163
{
127164
7z a "$Env:APPVEYOR_BUILD_FOLDER\$Env:APPVEYOR_PROJECT_NAME.zip" "$Env:APPVEYOR_BUILD_FOLDER\cov-int\"

0 commit comments

Comments
 (0)