@@ -10,6 +10,10 @@ skip_tags: true
1010clone_folder : C:\projects\libgit2sharp
1111
1212environment :
13+ coverity_token :
14+ secure : nuzUT+HecXGIi3KaPd/1hgFEZJan/j6+oNbPV75JKjk=
15+ coverity_email :
16+ secure : eGVilNg1Yuq+Xj+SW8r3WCtjnzhoDV0sNJkma4NRq7A=
1317 version : 0.22.0
1418 matrix :
1519 - xunit_runner : xunit.console.clr4.exe
@@ -43,6 +47,9 @@ install:
4347 $Env:SHOULD_PUBLISH_NUGET_ARTIFACT = $ShouldPublishNugetArtifact
4448 Write-Host "Should publish Nuget artifact = $Env:SHOULD_PUBLISH_NUGET_ARTIFACT"
4549
50+ $Env:SHOULD_PUBLISH_COVERITY_ANALYSIS = $($Env:APPVEYOR_SCHEDULED_BUILD -eq $True)
51+ Write-Host "Should publish Coverity analysis = $Env:SHOULD_PUBLISH_COVERITY_ANALYSIS"
52+
4653 cinst sourcelink -y
4754
4855assembly_info :
@@ -59,30 +66,59 @@ before_build:
5966- ps : nuget restore "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.sln"
6067
6168build_script :
62- - msbuild "%APPVEYOR_BUILD_FOLDER%\LibGit2Sharp.sln" /verbosity:normal /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /property:ExtraDefine="LEAKS_IDENTIFYING"
69+ - ps : |
70+ & cov-build.exe --dir cov-int msbuild "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.sln" `
71+ /verbosity:normal `
72+ /p:Configuration=Release `
73+ /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" `
74+ /property:ExtraDefine="LEAKS_IDENTIFYING"
6375
6476test_script :
65- - ps : & "$Env:xunit_runner" "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor
77+ - ps : |
78+ If ($Env:SHOULD_PUBLISH_COVERITY_ANALYSIS -eq $False)
79+ {
80+ & "$Env:xunit_runner" "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor
81+ }
6682
67- on_success :
83+ after_test :
6884- ps : |
69- & "$Env:APPVEYOR_BUILD_FOLDER\nuget.package\BuildNugetPackage.ps1" `
70- -commitSha "$Env:APPVEYOR_REPO_COMMIT" `
71- -postBuild { sourcelink index `
72- -pr LibGit2Sharp.csproj `
73- -pp Configuration Release `
74- -nf Core\NativeDllName.cs `
75- -nf Core\UniqueIdentifier.cs `
76- -nf Properties\AssemblyInfo.cs `
77- -r .. `
78- -u 'https://raw.githubusercontent.com/libgit2/libgit2sharp/{0}/%var2%' }
79-
80- Add-Type -Path "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp\bin\Release\LibGit2Sharp.dll"
81- Write-Host "LibGit2Sharp version = $([LibGit2Sharp.GlobalSettings]::Version)" -ForegroundColor "Magenta"
82-
83- If ($Env:SHOULD_PUBLISH_NUGET_ARTIFACT -eq $True)
85+ If ($Env:SHOULD_PUBLISH_COVERITY_ANALYSIS -eq $False)
86+ {
87+ & "$Env:APPVEYOR_BUILD_FOLDER\nuget.package\BuildNugetPackage.ps1" `
88+ -commitSha "$Env:APPVEYOR_REPO_COMMIT" `
89+ -postBuild { sourcelink index `
90+ -pr LibGit2Sharp.csproj `
91+ -pp Configuration Release `
92+ -nf Core\NativeDllName.cs `
93+ -nf Core\UniqueIdentifier.cs `
94+ -nf Properties\AssemblyInfo.cs `
95+ -r .. `
96+ -u 'https://raw.githubusercontent.com/libgit2/libgit2sharp/{0}/%var2%' }
97+
98+ Add-Type -Path "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp\bin\Release\LibGit2Sharp.dll"
99+ Write-Host "LibGit2Sharp version = $([LibGit2Sharp.GlobalSettings]::Version)" -ForegroundColor "Magenta"
100+
101+ If ($Env:SHOULD_PUBLISH_NUGET_ARTIFACT -eq $True)
102+ {
103+ Get-ChildItem "$Env:APPVEYOR_BUILD_FOLDER\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
104+ }
105+ }
106+ Else
84107 {
85- Get-ChildItem "$Env:APPVEYOR_BUILD_FOLDER\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
108+ & nuget install PublishCoverity -Version 0.9.0 -ExcludeVersion -OutputDirectory .\packages
109+
110+ & .\packages\PublishCoverity\PublishCoverity.exe compress `
111+ -i "$Env:APPVEYOR_BUILD_FOLDER\cov-int" `
112+ -o "$Env:APPVEYOR_BUILD_FOLDER\$Env:APPVEYOR_PROJECT_NAME.zip"
113+
114+ & .\packages\PublishCoverity\PublishCoverity.exe publish `
115+ -t "$Env:coverity_token" `
116+ -e "$Env:coverity_email" `
117+ -r "$Env:APPVEYOR_REPO_NAME" `
118+ -z "$Env:APPVEYOR_BUILD_FOLDER\$env:APPVEYOR_PROJECT_NAME.zip" `
119+ -d "CI server scheduled build." `
120+ --codeVersion "$Env:ASSEMBLY_INFORMATIONAL_VERSION" `
121+ --nologo
86122 }
87123
88124notifications :
0 commit comments