-
Notifications
You must be signed in to change notification settings - Fork 359
Expand file tree
/
Copy pathdefault-build.yml
More file actions
100 lines (94 loc) · 3.4 KB
/
default-build.yml
File metadata and controls
100 lines (94 loc) · 3.4 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
parameters:
ReleaseBuildTarget: ''
OtherBuildTarget: ''
jobs:
- job: build
displayName: Build
${{ if eq(variables['System.TeamProject'], 'public') }}:
pool:
name: NetCore-Svc-Public
demands: ImageOverride -equals 1es-windows-2022-open
timeoutInMinutes: 30
strategy:
matrix:
Release:
_BuildTarget: ${{ parameters.ReleaseBuildTarget }}
_Configuration: Release
_StyleCopEnabled: true
# Do CG work only in internal pipelines.
skipComponentGovernanceDetection: ${{ eq(variables['System.TeamProject'], 'public') }}
Debug:
_BuildTarget: ${{ parameters.OtherBuildTarget }}
_Configuration: Debug
_StyleCopEnabled: false
# Do not redo CG work. Configuration changes in this part of the matrix are not relevant to CG.
skipComponentGovernanceDetection: true
CodeAnalysis:
_BuildTarget: ${{ parameters.OtherBuildTarget }}
_Configuration: CodeAnalysis
_StyleCopEnabled: false
# Do not redo CG work. Configuration changes in this part of the matrix are not relevant to CG.
skipComponentGovernanceDetection: true
steps:
- checkout: self
clean: true
displayName: Checkout
- task: UseDotNet@2
displayName: Get .NET SDK
inputs:
useGlobalJson: true
- task: UseDotNet@2
displayName: Get .NET 2.1 runtime
inputs:
packageType: runtime
version: '2.1.x'
- task: UseDotNet@2
displayName: Get .NET 6.0 runtime
inputs:
packageType: runtime
version: '6.0.x'
- script: .\build.cmd EnableSkipStrongNames
displayName: Enable SkipStrongNames
- script: .\build.cmd $(_BuildTarget) ^
/binaryLogger:artifacts/msbuild.binlog /p:Configuration=$(_Configuration) /p:StyleCopEnabled=$(_StyleCopEnabled) ^
/fileLoggerParameters:LogFile=artifacts/msbuild.log;Summary;Verbosity=minimal
displayName: Build
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
- task: PublishBuildArtifacts@1
displayName: Upload test results
condition: and(always(), ne(variables._BuildTarget, 'Build'))
continueOnError: true
inputs:
pathtoPublish: ./bin/$(_Configuration)/Test/TestResults/
artifactName: $(_Configuration) Test Results $(System.JobId)
artifactType: Container
parallel: true
- task: PublishTestResults@2
condition: and(always(), ne(variables._BuildTarget, 'Build'))
continueOnError: true
displayName: Publish test results
inputs:
mergeTestResults: true
searchFolder: ./bin/$(_Configuration)/Test/TestResults/
testResultsFiles: '*.xml'
testRunner: xUnit
testRunTitle: $(_Configuration)
- task: PublishBuildArtifacts@1
displayName: Upload logs
condition: always()
continueOnError: true
inputs:
pathtoPublish: ./artifacts/
artifactName: $(_Configuration) Logs $(System.JobId)
artifactType: Container
parallel: true
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- task: 1ES.PublishPipelineArtifact@1
inputs:
condition: and(always(), ne(variables._BuildTarget, 'Build'))
path: ./bin/$(_Configuration)/Test/TestResults/
artifact: $(_Configuration) Test Results $(System.JobId)
- task: 1ES.PublishPipelineArtifact@1
inputs:
path: ./artifacts/
artifact: $(_Configuration) Logs $(System.JobId)