-
Notifications
You must be signed in to change notification settings - Fork 236
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
118 lines (111 loc) · 3.41 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
118 lines (111 loc) · 3.41 KB
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
name: $(PackageVersion).$(VersionBuildNumber)
schedules:
- cron: "0 1 * * *"
displayName: Nightly
branches:
include:
- master
always: true
trigger:
batch: true
branches:
include:
- master
pr:
branches:
include:
- '*'
paths:
exclude:
- 'docs/*'
- '.github/*'
variables:
PackageVersion: '4.16.0'
VersionBuildNumber: $[counter('4.16.0', 1)]
NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
LibManCacheWindows: $(USERPROFILE)/.librarymanager/cache
LibManCacheMacLinux: $(HOME)/.librarymanager/cache
RestoreLockedMode: true
pool:
vmImage: 'windows-latest'
stages:
- template: pipeline-templates/update-package-lock-files-stage.yml
- stage: Analysis
dependsOn: UpdatePackageLockFiles
condition: and(and(not(failed()), not(canceled())), eq(variables['System.PullRequest.IsFork'], 'False'))
jobs:
- job:
displayName: Run Sonar Analysis
dependsOn: []
steps:
- task: UseDotNet@2
displayName: 'Use dotnet LTS'
inputs:
version: 10.x
- task: DotNetCoreCLI@2
displayName: 'Install dotnet-coverage'
inputs:
command: custom
custom: tool
arguments: install dotnet-coverage --tool-path $(Agent.BuildDirectory)/tools
includeNuGetOrg: true
- template: pipeline-templates/populate-cache-steps.yml
- task: SonarCloudPrepare@4
inputs:
SonarCloud: 'SonarCloud stryker-net'
organization: 'stryker-net'
scannerMode: 'dotnet'
projectKey: 'stryker-net'
projectName: 'Stryker .NET'
projectVersion: '$(PackageVersion)'
extraProperties: |
sonar.verbose=true
sonar.cs.vscoveragexml.reportsPaths=$(Agent.BuildDirectory)\TestResults\coverage.xml
- task: DotNetCoreCLI@2
displayName: 'Build Stryker'
inputs:
command: 'build'
projects: 'src/Stryker.slnx'
- pwsh: '$(Agent.BuildDirectory)/tools/dotnet-coverage collect "dotnet test Stryker.vstest.slnf" -f xml -o "$(Agent.BuildDirectory)\TestResults\coverage.xml"'
displayName: 'Run unit tests'
workingDirectory: 'src'
- task: SonarCloudAnalyze@4
- task: SonarCloudPublish@4
inputs:
pollingTimeoutSec: '300'
- stage: PublishMasterReleaseArtifact
displayName: Publish Release Artifact
dependsOn: Analysis
condition: and(and(not(failed()), not(canceled())), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
jobs:
- job: PublishRelease
displayName: Publish Release Artifacts
steps:
- template: pipeline-templates/populate-cache-steps.yml
- task: UseDotNet@2
displayName: 'Use dotnet'
inputs:
version: 8.x
- task: UseDotNet@2
displayName: 'Use dotnet'
inputs:
version: 10.x
- task: DotNetCoreCLI@2
displayName: 'Pack Stryker.CLI'
inputs:
command: custom
custom: pack
arguments: --output $(Build.ArtifactStagingDirectory)/release
workingDirectory: 'src/Stryker.CLI/Stryker.CLI'
- task: DotNetCoreCLI@2
displayName: 'Pack Stryker.Core'
inputs:
command: custom
custom: pack
arguments: --output $(Build.ArtifactStagingDirectory)/release
workingDirectory: 'src/Stryker.Core/Stryker.Core'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: release'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/release'
ArtifactName: release