|
1 | | -version: '{build}' |
2 | | - |
3 | | -os: Visual Studio 2019 |
4 | | - |
| 1 | +# Disable AppVeyor |
5 | 2 | branches: |
6 | | - only: |
7 | | - - master |
8 | | - - /^maint.*/ |
9 | | - |
10 | | -configuration: release |
11 | | - |
12 | | -skip_tags: true |
13 | | - |
14 | | -nuget: |
15 | | - disable_publish_on_pr: true |
16 | | - |
17 | | -environment: |
18 | | - coveralls_token: |
19 | | - secure: ixIsBslo9NheDb5lJknF58EYdgvZ0r3/L0ecRiXjfXmjHBLvoSU6/ZRwaMM+BAlG |
20 | | - coverity_token: |
21 | | - secure: nuzUT+HecXGIi3KaPd/1hgFEZJan/j6+oNbPV75JKjk= |
22 | | - coverity_email: |
23 | | - secure: eGVilNg1Yuq+Xj+SW8r3WCtjnzhoDV0sNJkma4NRq7A= |
24 | | - matrix: |
25 | | - - publish_on_success: False |
26 | | - ExtraDefine: LEAKS_IDENTIFYING |
27 | | - - publish_on_success: True |
28 | | - |
29 | | -matrix: |
30 | | - fast_finish: true |
31 | | - |
32 | | -install: |
33 | | -- ps: | |
34 | | - Write-Host "Commit being built = " -NoNewLine |
35 | | - Write-Host $Env:APPVEYOR_REPO_COMMIT -ForegroundColor "Green" |
36 | | - Write-Host "Target branch = " -NoNewLine |
37 | | - Write-Host $Env:APPVEYOR_REPO_BRANCH -ForegroundColor "Green" |
38 | | - Write-Host "Is a Pull Request = " -NoNewLine |
39 | | - Write-Host $($Env:APPVEYOR_PULL_REQUEST_NUMBER -ne $null) -ForegroundColor "Green" |
40 | | -
|
41 | | - $CommitDate = [DateTime]::Parse($Env:APPVEYOR_REPO_COMMIT_TIMESTAMP) |
42 | | - $BuildDate = $CommitDate.ToUniversalTime().ToString("yyyyMMddHHmmss") |
43 | | - Write-Host "Merge commit UTC timestamp = " -NoNewLine |
44 | | - Write-Host $BuildDate -ForegroundColor "Green" |
45 | | -
|
46 | | - $Env:SHOULD_RUN_COVERITY_ANALYSIS = $($Env:APPVEYOR_SCHEDULED_BUILD -eq $True) |
47 | | - Write-Host "Should run Coverity analysis = " -NoNewLine |
48 | | - Write-Host $Env:SHOULD_RUN_COVERITY_ANALYSIS -ForegroundColor "Green" |
49 | | -
|
50 | | - $Env:SHOULD_RUN_COVERALLS = $($Env:APPVEYOR_SCHEDULED_BUILD -eq $True) |
51 | | - Write-Host "Should run Coveralls = " -NoNewLine |
52 | | - Write-Host $Env:SHOULD_RUN_COVERALLS -ForegroundColor "Green" |
53 | | -
|
54 | | - Write-Host "Identifying leaks = " -NoNewLine |
55 | | - Write-Host ($Env:ExtraDefine -eq "LEAKS_IDENTIFYING") -ForegroundColor "Green" |
56 | | -
|
57 | | - Write-Host "Should publish on success = " -NoNewLine |
58 | | - Write-Host $Env:publish_on_success -ForegroundColor "Green" |
59 | | -
|
60 | | - If ($Env:SHOULD_RUN_COVERALLS -eq $True) |
61 | | - { |
62 | | - nuget install OpenCover -Version 4.6.166 -ExcludeVersion -OutputDirectory .\packages |
63 | | - nuget install coveralls.net -Version 0.6.0 -ExcludeVersion -OutputDirectory .\packages |
64 | | - } |
65 | | -
|
66 | | - If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $True) |
67 | | - { |
68 | | - cinst curl -y |
69 | | - } |
70 | | -
|
71 | | - ./tools/Install-DotNetSdk.ps1 |
72 | | -
|
73 | | -before_build: |
74 | | -- ps: | |
75 | | - msbuild "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.sln" ` |
76 | | - /nologo /verbosity:quiet ` |
77 | | - /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" ` |
78 | | - /t:restore |
79 | | -
|
80 | | -build_script: |
81 | | -- ps: | |
82 | | - & cov-build.exe --dir cov-int msbuild "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.sln" ` |
83 | | - /nologo /verbosity:minimal /fl /flp:verbosity=normal ` |
84 | | - /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" ` |
85 | | - /t:build,pack |
86 | | -
|
87 | | -test_script: |
88 | | -- ps: | |
89 | | - Foreach ($runner in 'xunit.console.exe','xunit.console.x86.exe') |
90 | | - { |
91 | | - If ($Env:SHOULD_RUN_COVERALLS -eq $True -and $Env:publish_on_success -eq $True) |
92 | | - { |
93 | | - .\packages\OpenCover\tools\OpenCover.Console.exe ` |
94 | | - -register:user ` |
95 | | - "-target:""$Env:userprofile\.nuget\packages\xunit.runner.console\2.4.1\tools\net46\$runner""" ` |
96 | | - "-targetargs:""$Env:APPVEYOR_BUILD_FOLDER\bin\LibGit2Sharp.Tests\Release\net46\LibGit2Sharp.Tests.dll"" -noshadow" ` |
97 | | - "-filter:+[LibGit2Sharp]* -[LibGit2Sharp.Tests]*" ` |
98 | | - -hideskipped:All ` |
99 | | - -output:opencoverCoverage.xml |
100 | | - } |
101 | | - ElseIf ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $False) |
102 | | - { |
103 | | - & "$Env:userprofile\.nuget\packages\xunit.runner.console\2.4.1\tools\net46\$runner" ` |
104 | | - "$Env:APPVEYOR_BUILD_FOLDER\bin\LibGit2Sharp.Tests\Release\net46\LibGit2Sharp.Tests.dll" -noshadow |
105 | | - } |
106 | | - } |
107 | | -
|
108 | | -- dotnet test LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj -f netcoreapp2.1 --no-restore --no-build |
109 | | - |
110 | | -after_test: |
111 | | -- ps: | |
112 | | - If ($Env:SHOULD_RUN_COVERALLS -eq $True -and $Env:publish_on_success -eq $True) |
113 | | - { |
114 | | - Write-Host "Uploading code coverage result..." -ForegroundColor "Green" |
115 | | -
|
116 | | - .\packages\coveralls.net\tools\csmacnz.Coveralls.exe ` |
117 | | - --opencover -i opencoverCoverage.xml ` |
118 | | - --repoToken $Env:coveralls_token ` |
119 | | - --useRelativePaths ` |
120 | | - --basePath "$Env:APPVEYOR_BUILD_FOLDER\"` |
121 | | - } |
122 | | -
|
123 | | - If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $True -and $Env:publish_on_success -eq $True) |
124 | | - { |
125 | | - 7z a "$Env:APPVEYOR_BUILD_FOLDER\$Env:APPVEYOR_PROJECT_NAME.zip" "$Env:APPVEYOR_BUILD_FOLDER\cov-int\" |
126 | | -
|
127 | | - # cf. http://stackoverflow.com/a/25045154/335418 |
128 | | - Remove-item alias:curl |
129 | | -
|
130 | | - Write-Host "Uploading Coverity analysis result..." -ForegroundColor "Green" |
131 | | -
|
132 | | - curl --silent --show-error ` |
133 | | - --output curl-out.txt ` |
134 | | - --form token="$Env:coverity_token" ` |
135 | | - --form email="$Env:coverity_email" ` |
136 | | - --form "file=@$Env:APPVEYOR_BUILD_FOLDER\$Env:APPVEYOR_PROJECT_NAME.zip" ` |
137 | | - --form version="$Env:APPVEYOR_REPO_COMMIT" ` |
138 | | - --form description="CI server scheduled build." ` |
139 | | - https://scan.coverity.com/builds?project=libgit2%2Flibgit2sharp |
140 | | -
|
141 | | - cat .\curl-out.txt |
142 | | - } |
143 | | -
|
144 | | -on_finish: |
145 | | -- ps: Push-AppveyorArtifact "msbuild.log" |
146 | | - |
147 | | -on_success: |
148 | | -- ps: | |
149 | | - if ($Env:publish_on_success -eq $True) |
150 | | - { |
151 | | - Get-ChildItem "bin\LibGit2Sharp\$env:configuration\*.nupkg" |% { Push-AppveyorArtifact $_.FullName -FileName $_.Name } |
152 | | - } |
153 | | -
|
154 | | -notifications: |
155 | | -- provider: Email |
156 | | - to: |
157 | | - - emeric.fermas@gmail.com |
158 | | - on_build_status_changed: true |
| 3 | + only: |
| 4 | + - NOTTHISONE |
0 commit comments