forked from JanuszNowak/janono.ado.testcase.associate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.janono.ado.testcase.associate.yml
210 lines (185 loc) · 6.09 KB
/
azure-pipelines.janono.ado.testcase.associate.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
202
203
204
205
206
207
208
209
210
trigger:
- master
- develop
- feature/*
pr:
branches:
include:
- master
- develop
- releases/*
exclude:
- releases/old*
paths:
include:
- '*' # same as '/' for the repository root
exclude:
- 'docs/*' # same as 'docs/'
pool:
vmImage: ubuntu-latest
variables:
buildConfiguration: 'Release'
dotNetVersion: '6.0.x'
dotNetFramework: 'net6.0'
targetRuntime: 'linux-x64'
projectKey: 'JanuszNowak_janono.ado.testcase.associate'
system.debug: true
# resources:
# repositories:
# - repository: janono.ado.templates
# type: github
# name: JanuszNowak/janono.ado.templates
# source: JanuszNowak/janono.ado.templates
# ref: refs/heads/master
# endpoint: janusznowak
# trigger:
# branches:
# include:
# - releases/*
# - master
# exclude:
# - topic/*
jobs:
#- template: src/common/CodeFormatting-Job.yml@janono.ado.templates
- job: AgentJobCode_Formatting
displayName: Agent job - Code Formatting
pool:
vmImage: ubuntu-latest
steps:
- bash: |
npm install -g eclint
eclint check
displayName: "eclint check"
- job: AgentJobSonar
displayName: Agent job - Sonar
pool:
vmImage: ubuntu-latest
steps:
- task: gitversion/setup@0
displayName: gitversion/setup
inputs:
versionSpec: 5.x
includePrerelease: true
- task: gitversion/execute@0
displayName: gitversion/execute
- task: SonarCloudPrepare@1
displayName: 'Prepare analysis on SonarCloud'
inputs:
SonarCloud: sonarcloud.io
organization: 'janusznowak-github'
scannerMode: CLI
configMode: manual
cliProjectKey: 'JanuszNowak_janono.ado.testcase.associate'
cliProjectName: JanuszNowak/janono.ado.testcase.associate
cliProjectVersion: '$(Build.BuildNumber)'
extraProperties: |
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
# sonar.exclusions=**/*.bin
sonar.branch.name=$(Build.SourceBranchName)
- task: SonarCloudAnalyze@1
displayName: 'Run Code Analysis'
- task: SonarCloudPublish@1
displayName: 'Publish Quality Gate Result'
- job: AgentJobMain
displayName: Agent job - Main
pool:
vmImage: ubuntu-latest
#vmImage: windows-latest
steps:
- task: gitversion/setup@0
displayName: gitversion/setup
inputs:
versionSpec: 5.x
includePrerelease: true
- task: gitversion/execute@0
displayName: gitversion/execute
- task: DownloadSecureFile@1
name: janonosnk
displayName: 'Download secure file'
inputs:
secureFile: janono.snk
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Get-ChildItem env:
# - task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1
# displayName: 'Prepare analysis on SonarCloud'
# inputs:
# SonarCloud: sonarcloud.io
# organization: 'janono-pub'
# projectKey: '$(projectKey)'
# projectName: '$(BUILD.REPOSITORY.NAME)'
- task: UseDotNet@2
inputs:
version: $(dotNetVersion)
includePreviewVersions: true
- script: dotnet build --configuration $(buildConfiguration) /p:Version=$(GitVersion.FullSemVer) /p:AssemblyVersion=$(GitVersion.AssemblySemVer) /p:FileVersion=$(GitVersion.AssemblySemFileVer) /m /p:AssemblyOriginatorKeyFile=$(janonosnk.secureFilePath) /p:SignAssembly=true
displayName: 'dotnet build'
- script: dotnet test --configuration $(buildConfiguration) --logger trx --collect:"XPlat Code Coverage"
#--collect "Code Coverage" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
displayName: 'dotnet test'
- task: PublishTestResults@2
displayName: 'Publish Test Results **/TestResults/*.trx'
inputs:
testResultsFormat: VSTest
testResultsFiles: '**/TestResults/*.trx'
mergeTestResults: true
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/*coverage.cobertura.xml'
- script: dotnet pack --configuration $(buildConfiguration) --include-symbols --output '$(Build.ArtifactStagingDirectory)' /p:Version=$(GitVersion.FullSemVer) /p:AssemblyVersion=$(GitVersion.AssemblySemVer) /p:FileVersion=$(GitVersion.AssemblySemFileVer) /m /p:AssemblyOriginatorKeyFile=$(janonosnk.secureFilePath) /p:SignAssembly=true
displayName: 'dotnet pack'
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'nuget.org_janono.ado.testcase.associate'
allowPackageConflicts: true
includeSymbols: true
continueOnError: true
enabled: false
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'nuget.pkg.github.com_janono.ado.testcase.associate'
allowPackageConflicts: true
includeSymbols: true
continueOnError: true
enabled: false
# - task: SonarCloudAnalyze@1
# enabled: true
# - task: SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1
# displayName: 'Publish Quality Gate Result'
- task: mspremier.BuildQualityChecks.QualityChecks-task.BuildQualityChecks@8
displayName: 'Check build quality'
inputs:
checkWarnings: true
checkCoverage: true
enabled: false
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: 'drop'
- task: DotNetCoreCLI@2
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'janono.ado.testcase.associate'
enabled: false
continueOnError: true
- task: DotNetCoreCLI@2
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'nuget.org_janono.ado.testcase.associate'
enabled: false
continueOnError: true