forked from KeRNeLith/QuikGraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
201 lines (175 loc) · 6.34 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
version: '0.0.{build}'
image: Visual Studio 2017
# Setup environment
nuget:
disable_publish_on_pr: true
pull_requests:
do_not_increment_build_number: true
branches:
except:
- /tmp|temp/
skip_commits:
files:
- .github/
- .gitattributes
- .gitignore
- LICENSE
- README.md
- CONTRIBUTING.md
- ISSUE_TEMPLATE.md
- CODE_OF_CONDUCT.md
- '**/*.DotSettings'
environment:
SONARQUBE_TOKEN:
secure: 2I3bluR+2upDl17M1Qmnil/eSAhUFcv4uaW5vvZOveWsFkYY773KQtLmK7H8dcLI
DocFXVersion: 2.42.4
OpenCoverVersion: 4.7.922
CoverallsVersion: 1.0.0
COVERALLS_REPO_TOKEN:
secure: V9+BC6iS7KQL2KD+Wo2HrCYWP81uJqeAOH+SM6imJfwAGT4jmFO2K7LebXyZXTKy
GITHUB_ACCESS_TOKEN:
secure: fLTTmcGOM55kigJC4vErpObFmybCtzQtwb4QN55BTNq3GDGaOCoHDoIPxexzO59d
GITHUB_EMAIL:
secure: wcfqCHOmeRLZf/BX6u6qQSV89Q4jFs9fHNDgMpKAcqE=
# Setup build version
init:
- ps: >-
if ($env:APPVEYOR_REPO_TAG -eq "true")
{
$env:Build_Version = "$($env:APPVEYOR_REPO_TAG_NAME.Replace('v', ''))";
$env:Build_Assembly_Version = $env:Build_Version;
$env:IsFullIntegrationBuild = $true;
}
else
{
$env:Build_Version = "$($env:APPVEYOR_BUILD_VERSION)";
$env:Build_Assembly_Version = "$env:Build_Version" -replace "\-.*","";
$env:IsFullIntegrationBuild = "$env:APPVEYOR_PULL_REQUEST_NUMBER" -eq "" -And $env:Configuration -eq "Release";
}
"Building version: $env:Build_Version";
"Building assembly version: $env:Build_Assembly_Version";
if ($env:IsFullIntegrationBuild -eq $true)
{
"With full integration";
}
else
{
"Without full integration";
}
# Assembly infos & csproj patching
assembly_info:
patch: true
file: '**\\AssemblyInfo.*'
assembly_version: '$(Build_Assembly_Version)'
assembly_file_version: '$(Build_Assembly_Version)'
assembly_informational_version: '$(Build_Version)'
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: '$(Build_Assembly_Version)'
package_version: '$(Build_Version)'
assembly_version: '$(Build_Assembly_Version)'
file_version: '$(Build_Assembly_Version)'
informational_version: '$(Build_Version)'
# Build configurations
platform:
- Any CPU
configuration:
- Debug
- Release
matrix:
fast_finish: true
# Build
before_build:
# NuGet restore
- nuget restore -verbosity detailed
# SonarQube
- ps: >-
if ($env:IsFullIntegrationBuild -eq $true)
{
dotnet tool install --tool-path tools dotnet-sonarscanner
$sonarScanner = (Resolve-Path "tools\dotnet-sonarscanner.exe").ToString()
}
build:
verbosity: minimal
build_script:
# Start SonarQube analysis (only for Release configuration)
- ps: $analysisFile = (Convert-Path SonarQube.Analysis.xml).ToString()
- ps: >-
if ($env:IsFullIntegrationBuild -eq $true)
{
& $sonarScanner begin /k:"quikgraph" /s:$analysisFile /o:"kernelith-github" /d:sonar.host.url="https://sonarcloud.io" /d:"sonar.branch.name=$env:APPVEYOR_REPO_BRANCH" /d:sonar.cs.opencover.reportsPaths="coverage.xml" /d:sonar.login="$env:SONARQUBE_TOKEN"
}
- msbuild
before_test:
# NuGet packages for test & coverage
- ps: >-
if ($env:IsFullIntegrationBuild -eq $true)
{
nuget install OpenCover -Version $env:OpenCoverVersion -OutputDirectory tools
dotnet tool install --tool-path tools --version $env:CoverallsVersion coveralls.net
}
test_script:
# Test & generate coverage report
- ps: >-
$nunitFolder = (Resolve-Path "$env:SYSTEMDRIVE\Tools\NUnit3").ToString();
$nunitConsole = (Resolve-Path "$nunitFolder\nunit3-console.exe").ToString();
# Only take test assemblies matching their folder name
# Example:
# Directory = src\TestProject.Tests\bin\CONFIGURATION\TARGET
# Directory.Parent = src\TestProject.Tests\bin\CONFIGURATION
# Directory.Parent.Parent = src\TestProject.Tests\bin
# Directory.Parent.Parent.Parent = src\TestProject.Tests
$testAssemblies = (ls tests\*.Tests\bin\$env:Configuration\net45\*Tests.dll | Where-Object { $_ -Match "net*" -and $_ -NotMatch "netcoreapp*" -and [System.IO.Path]::GetFileNameWithoutExtension($_.FullName) -Match $_.Directory.Parent.Parent.Parent.Name } | % FullName | sort-object -Unique)
if ($env:IsFullIntegrationBuild -eq $true)
{
$opencover = (Resolve-Path "tools\OpenCover.*\tools\OpenCover.Console.exe").ToString();
$coveralls = (Resolve-Path "tools\csmacnz.Coveralls.exe").ToString();
& $opencover -register:Path64 -filter:"+[*]* -[*.Test*]* -[*]JetBrains.Annotations*" -excludebyfile:"*\Dgml.cs;*\SortedSet.cs;*\BitHelper.cs" -hideskipped:File -target:"$nunitConsole" -targetargs:"$testAssemblies --where \`"cat != VerboseTest and cat != CISkip\`"" -returntargetcode -log:Warn -output:coverage.xml
& $sonarScanner end /d:"sonar.login=$env:SONARQUBE_TOKEN"
& $coveralls --opencover -i coverage.xml --repoToken $env:COVERALLS_REPO_TOKEN --useRelativePaths --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_BUILD_NUMBER --serviceName appveyor
}
else
{
& $nunitConsole $testAssemblies --where "cat != VerboseTest and cat != CISkip"
}
# Artifact
artifacts:
- path: '**\bin\Release\*.nupkg'
name: NuGet
# Documentation
before_deploy:
# Release documentation
- ps: ./releaseDoc.ps1
# Deploy
deploy:
# MyGet
- provider: NuGet
server: https://www.myget.org/F/kernelith-ci/api/v2/package
api_key:
secure: ANF+joC2B+NahxCFbLPOjNvEAo36F2F4QJu6zLwoIf2I9KwkxKyCSuNxDpLmJmtU
skip_symbols: true
on:
configuration: Release
# NuGet
- provider: NuGet
api_key:
secure: a/0jxqKB5mP/ED1AIQ6YxAoiYZP93M5NQpyZbq40Tkzg+ye0MhFHlDQFBUefrseY
on:
branch: master
configuration: Release
APPVEYOR_REPO_TAG: true
# GitHub
- provider: GitHub
auth_token:
secure: fLTTmcGOM55kigJC4vErpObFmybCtzQtwb4QN55BTNq3GDGaOCoHDoIPxexzO59d
release: '${Build_Version}'
description: 'Version ${Build_Version}'
artifact: NuGet
draft: false
prerelease: false
force_update: true
on:
branch: master
configuration: Release
APPVEYOR_REPO_TAG: true