8000 Merge pull request #1066 from libgit2/ntk/coverity_appveyor · leoniDEV/libgit2sharp@77691c2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 77691c2

Browse files
committed
Merge pull request libgit2#1066 from libgit2/ntk/coverity_appveyor
Make AppVeyor run Coverity scan
2 parents 01b4c5e + 61fdbed commit 77691c2

File tree

1 file changed

+76
-18
lines changed

1 file changed

+76
-18
lines changed

appveyor.yml

Lines changed: 76 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ skip_tags: true
1010
clone_folder: C:\projects\libgit2sharp
1111

1212
environment:
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
@@ -22,23 +26,38 @@ matrix:
2226

2327
install:
2428
- ps: |
25-
Write-Host "Commit being built = $($Env:APPVEYOR_REPO_COMMIT)"
26-
Write-Host "Current build version = $($Env:VERSION)"
27-
Write-Host "Target branch = $($Env:APPVEYOR_REPO_BRANCH)"
28-
Write-Host "Is a Pull Request = $($Env:APPVEYOR_PULL_REQUEST_NUMBER -ne $null)"
29+
Write-Host "Commit being built = " -NoNewLine
30+
Write-Host $Env:APPVEYOR_REPO_COMMIT -ForegroundColor "Green"
31+
Write-Host "Current build version = " -NoNewLine
32+
Write-Host $Env:VERSION -ForegroundColor "Green"
33+
Write-Host "Target branch = " -NoNewLine
34+
Write-Host $Env:APPVEYOR_REPO_BRANCH -ForegroundColor "Green"
35+
Write-Host "Is a Pull Request = " -NoNewLine
36+
Write-Host $($Env:APPVEYOR_PULL_REQUEST_NUMBER -ne $null) -ForegroundColor "Green"
37+
2938
$BuildDate = (Get-Date).ToUniversalTime().ToString("yyyyMMddHHmmss")
30-
Write-Host "Build UTC date = $BuildDate"
39+
Write-Host "Build UTC date = " -NoNewLine
40+
Write-Host $BuildDate -ForegroundColor "Green"
41+
3142
$VersionSuffix = ""
3243
If ($Env:APPVEYOR_REPO_BRANCH -ne "master")
3344
{
3445
$VersionSuffix = "-pre$BuildDate"
3546
}
3647
$Version = "$($Env:VERSION)$($VersionSuffix)"
3748
$Env:ASSEMBLY_INFORMATIONAL_VERSION = $Version
38-
Write-Host "Assembly informational version = $($Env:ASSEMBLY_INFORMATIONAL_VERSION)"
39-
$ShouldPublishNugetArtifact = "$($env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)"
49+
Write-Host "Assembly informational version = " -NoNewLine
50+
Write-Host $Env:ASSEMBLY_INFORMATIONAL_VERSION -ForegroundColor "Green"
51+
52+
$ShouldPublishNugetArtifact = $($Env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)
4053
$Env:SHOULD_PUBLISH_NUGET_ARTIFACT = $ShouldPublishNugetArtifact
41-
Write-Host "Should publish Nuget artifact = $($Env:SHOULD_PUBLISH_NUGET_ARTIFACT)"
54+
Write-Host "Should publish Nuget artifact = " -NoNewLine
55+
Write-Host $Env:SHOULD_PUBLISH_NUGET_ARTIFACT -ForegroundColor "Green"
56+
57+
$Env:SHOULD_PUBLISH_COVERITY_ANALYSIS = $($Env:APPVEYOR_SCHEDULED_BUILD -eq $True)
58+
Write-Host "Should publish Coverity analysis = " -NoNewLine
59+
Write-Host $Env:SHOULD_PUBLISH_COVERITY_ANALYSIS -ForegroundColor "Green"
60+
4261
cinst sourcelink -y
4362
4463
assembly_info:
@@ -52,23 +71,62 @@ cache:
5271
- packages
5372

5473
before_build:
55-
- nuget restore "%APPVEYOR_BUILD_FOLDER%\LibGit2Sharp.sln"
74+
- ps: nuget restore "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.sln"
5675

5776
build_script:
58-
- msbuild "%APPVEYOR_BUILD_FOLDER%\LibGit2Sharp.sln" /verbosity:normal /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /property:ExtraDefine="LEAKS_IDENTIFYING"
77+
- ps: |
78+
& cov-build.exe --dir cov-int msbuild "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.sln" `
79+
/verbosity:normal `
80+
/p:Configuration=Release `
81+
/logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" `
82+
/property:ExtraDefine="LEAKS_IDENTIFYING"
5983
6084
test_script:
61-
- '%xunit_runner% "%APPVEYOR_BUILD_FOLDER%\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor'
62-
- IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
85+
- ps: |
86+
If ($Env:SHOULD_PUBLISH_COVERITY_ANALYSIS -eq $False)
87+
{
88+
& "$Env:xunit_runner" "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor
89+
}
6390
64-
on_success:
91+
after_test:
6592
- ps: |
66-
& "$env:APPVEYOR_BUILD_FOLDER\nuget.package\BuildNugetPackage.ps1" -commitSha "$env:APPVEYOR_REPO_COMMIT" -postBuild { sourcelink index -pr LibGit2Sharp.csproj -pp Configuration Release -nf Core\NativeDllName.cs -nf Core\UniqueIdentifier.cs -nf Properties\AssemblyInfo.cs -r .. -u 'https://raw.githubusercontent.com/libgit2/libgit2sharp/{0}/%var2%' }
67-
Add-Type -Path "$env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp\bin\Release\LibGit2Sharp.dll"
68-
Write-Host "LibGit2Sharp version = $([LibGit2Sharp.GlobalSettings]::Version)" -ForegroundColor "Magenta"
69-
If ($Env:SHOULD_PUBLISH_NUGET_ARTIFACT -eq $True)
93+
If ($Env:SHOULD_PUBLISH_COVERITY_ANALYSIS -eq $False)
7094
{
71-
Get-ChildItem "$env:APPVEYOR_BUILD_FOLDER\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
95+
& "$Env:APPVEYOR_BUILD_FOLDER\nuget.package\BuildNugetPackage.ps1" `
96+
-commitSha "$Env:APPVEYOR_REPO_COMMIT" `
97+
-postBuild { sourcelink index `
98+
-pr LibGit2Sharp.csproj `
99+
-pp Configuration Release `
100+
-nf Core\NativeDllName.cs `
101+
-nf Core\UniqueIdentifier.cs `
102+
-nf Properties\AssemblyInfo.cs `
103+
-r .. `
104+
-u 'https://raw.githubusercontent.com/libgit2/libgit2sharp/{0}/%var2%' }
105+
106+
Add-Type -Path "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp\bin\Release\LibGit2Sharp.dll"
107+
Write-Host "LibGit2Sharp version = $([LibGit2Sharp.GlobalSettings]::Version)" -ForegroundColor "Magenta"
108+
109+
If ($Env:SHOULD_PUBLISH_NUGET_ARTIFACT -eq $True)
110+
{
111+
Get-ChildItem "$Env:APPVEYOR_BUILD_FOLDER\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
112+
}
113+
}
114+
Else
115+
{
116+
& nuget install PublishCoverity -Version 0.9.0 -ExcludeVersion -OutputDirectory .\packages
117+
118+
& .\packages\PublishCoverity\PublishCoverity.exe compress `
119+
-i "$Env:APPVEYOR_BUILD_FOLDER\cov-int" `
120+
-o "$Env:APPVEYOR_BUILD_FOLDER\$Env:APPVEYOR_PROJECT_NAME.zip"
121+
122+
& .\packages\PublishCoverity\PublishCoverity.exe publish `
123+
-t "$Env:coverity_token" `
124+
-e "$Env:coverity_email" `
125+
-r "$Env:APPVEYOR_REPO_NAME" `
126+
-z "$Env:APPVEYOR_BUILD_FOLDER\$env:APPVEYOR_PROJECT_NAME.zip" `
127+
-d "CI server scheduled build." `
128+
--codeVersion "$Env:ASSEMBLY_INFORMATIONAL_VERSION" `
129+
--nologo
72130
}
73131
74132
notifications:

0 commit comments

Comments
 (0)
0