This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
81 lines (67 loc) · 2.79 KB
/
azure-pipelines.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
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
buildConfiguration: 'Release'
steps:
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'AzureDevopsSonarCloud'
organization: 'madsstorm'
scannerMode: 'MSBuild'
projectKey: 'madsstorm_CodeAnalyzers.Episerver'
projectName: 'CodeAnalyzers.Episerver'
- task: DotNetCoreCLI@2
displayName: 'Build'
inputs:
command: 'build'
projects: 'src/CodeAnalyzers.Episerver/CodeAnalyzers.Episerver.csproj'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Test Cms 9'
inputs:
command: 'test'
projects: 'test/CodeAnalyzers.Episerver.Test/CodeAnalyzers.Episerver.Cms9.Test.csproj'
arguments: '--configuration $(buildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=$(Build.SourcesDirectory)/TestResults/Coverage/'
- task: DotNetCoreCLI@2
displayName: 'Test Cms 10'
inputs:
command: 'test'
projects: 'test/CodeAnalyzers.Episerver.Test/CodeAnalyzers.Episerver.Cms10.Test.csproj'
arguments: '--configuration $(buildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=$(Build.SourcesDirectory)/TestResults/Coverage/ /p:MergeWith=$(Build.SourcesDirectory)/TestResults/Coverage/coverage.json'
- task: DotNetCoreCLI@2
displayName: 'Test Cms 11'
inputs:
command: 'test'
projects: 'test/CodeAnalyzers.Episerver.Test/CodeAnalyzers.Episerver.Cms11.Test.csproj'
arguments: '--configuration $(buildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=$(Build.SourcesDirectory)/TestResults/Coverage/ /p:MergeWith=$(Build.SourcesDirectory)/TestResults/Coverage/coverage.json /p:CoverletOutputFormat=cobertura'
- task: reportgenerator@4
displayName: 'Generate code coverage'
inputs:
reports: '$(Build.SourcesDirectory)/TestResults/Coverage/coverage.cobertura.xml'
targetdir: '$(Build.SourcesDirectory)/coveragereport'
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/coveragereport/Cobertura.xml'
reportDirectory: '$(Build.SourcesDirectory)/coveragereport'
- script: '%USERPROFILE%\.nuget\packages\codecov\1.7.2\tools\codecov.exe -f "$(Build.SourcesDirectory)/TestResults/Coverage/coverage.cobertura.xml" -t $(CODECOV_TOKEN)'
displayName: Upload coverage to codecov.io
- task: SonarCloudAnalyze@1
- task: SonarCloudPublish@1
inputs:
pollingTimeoutSec: '300'
- task: CopyFiles@2
displayName: 'Copy package'
inputs:
Contents: '**/Release/**/*.nupkg'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
FlattenFolders: true
- task: PublishBuildArtifacts@1
displayName: 'Publish artifact'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'