8000 Merge pull request #1078 from libgit2/ntk/coverity_the_sequel · leoniDEV/libgit2sharp@2a28329 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2a28329

Browse files
committed
Merge pull request libgit2#1078 from libgit2/ntk/coverity_the_sequel
Replace failing CoverityPublisher with plain 7zip and Curl
2 parents 77691c2 + 2f0ed89 commit 2a28329

File tree

1 file changed

+45
-31
lines changed

1 file changed

+45
-31
lines changed

appveyor.yml

Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ environment:
1616
secure: eGVilNg1Yuq+Xj+SW8r3WCtjnzhoDV0sNJkma4NRq7A=
1717
version : 0.22.0
1818
matrix:
19-
- xunit_runner: xunit.console.clr4.exe
20-
Arch: 64
2119
- xunit_runner: xunit.console.clr4.x86.exe
2220
Arch: 32
21+
publish_on_success: False
22+
- xunit_runner: xunit.console.clr4.exe
23+
Arch: 64
24+
publish_on_success: True
2325

2426
matrix:
2527
fast_finish: true
@@ -49,16 +51,27 @@ install:
4951
Write-Host "Assembly informational version = " -NoNewLine
5052
Write-Host $Env:ASSEMBLY_INFORMATIONAL_VERSION -ForegroundColor "Green"
5153
52-
$ShouldPublishNugetArtifact = $($Env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)
53-
$Env:SHOULD_PUBLISH_NUGET_ARTIFACT = $ShouldPublishNugetArtifact
54-
Write-Host "Should publish Nuget artifact = " -NoNewLine
55-
Write-Host $Env:SHOULD_PUBLISH_NUGET_ARTIFACT -ForegroundColor "Green"
54+
$Env:SHOULD_RUN_COVERITY_ANALYSIS = $($Env:APPVEYOR_SCHEDULED_BUILD -eq $True)
55+
Write-Host "Should run Coverity analysis = " -NoNewLine
56+
Write-Host $Env:SHOULD_RUN_COVERITY_ANALYSIS -ForegroundColor "Green"
5657
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"
58+
$Env:SHOULD_PACKAGE_NUGET_ARTIFACT = $($Env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null `
59+
-and $Env:APPVEYOR_SCHEDULED_BUILD -eq $False)
60+
Write-Host "Should package Nuget artifact = " -NoNewLine
61+
Write-Host $Env:SHOULD_PACKAGE_NUGET_ARTIFACT -ForegroundColor "Green"
6062
61-
cinst sourcelink -y
63+
Write-Host "Should publish on success = " -NoNewLine
64+
Write-Host $Env:publish_on_success -ForegroundColor "Green"
65+
66+
If ($Env:SHOULD_PACKAGE_NUGET_ARTIFACT -eq $True)
67+
{
68+
cinst sourcelink -y
69+
}
70+
71+
If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $True)
72+
{
73+
cinst curl -y
74+
}
6275
6376
assembly_info:
6477
patch: true
@@ -83,14 +96,14 @@ build_script:
8396
8497
test_script:
8598
- ps: |
86-
If ($Env:SHOULD_PUBLISH_COVERITY_ANALYSIS -eq $False)
99+
If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $False)
87100
{
88101
& "$Env:xunit_runner" "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor
89102
}
90103
91104
after_test:
92105
- ps: |
93-
If ($Env:SHOULD_PUBLISH_COVERITY_ANALYSIS -eq $False)
106+
If ($Env:SHOULD_PACKAGE_NUGET_ARTIFACT -eq $True -and $Env:publish_on_success -eq $True)
94107
{
95108
& "$Env:APPVEYOR_BUILD_FOLDER\nuget.package\BuildNugetPackage.ps1" `
96109
-commitSha "$Env:APPVEYOR_REPO_COMMIT" `
@@ -106,27 +119,28 @@ after_test:
106119
Add-Type -Path "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp\bin\Release\LibGit2Sharp.dll"
107120
Write-Host "LibGit2Sharp version = $([LibGit2Sharp.GlobalSettings]::Version)" -ForegroundColor "Magenta"
108121
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-
}
122+
Get-ChildItem "$Env:APPVEYOR_BUILD_FOLDER\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
113123
}
114-
Else
124+
125+
If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $True -and $Env:publish_on_success -eq $True)
115126
{
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
127+
7z a "$Env:APPVEYOR_BUILD_FOLDER\$Env:APPVEYOR_PROJECT_NAME.zip" "$Env:APPVEYOR_BUILD_FOLDER\cov-int\"
128+
129+
# cf. http://stackoverflow.com/a/25045154/335418
130+
Remove-item alias:curl
131+
132+
Write-Host "Uploading Coverity analysis result..." -ForegroundColor "Green"
133+
134+
curl --silent --show-error `
135+
--output curl-out.txt `
136+
--form token="$Env:coverity_token" `
137+
--form email="$Env:coverity_email" `
138+
--form "file=@$Env:APPVEYOR_BUILD_FOLDER\$Env:APPVEYOR_PROJECT_NAME.zip" `
139+
--form version="$Env:APPVEYOR_REPO_COMMIT" `
140+
--form description="CI server scheduled build." `
141+
https://scan.coverity.com/builds?project=libgit2%2Flibgit2sharp
142+
143+
cat .\curl-out.txt
130144
}
131145
132146
notifications:

0 commit comments

Comments
 (0)
0