1
1
parameters :
2
- - name : BuildTarget
3
- displayName : Build which target?
2
+ # Test only the Release build by default.
3
+ - name : ReleaseBuildTarget
4
+ displayName : ' Build which target for Release?'
4
5
type : string
5
6
values : [ Build, Integration, UnitTest ]
6
7
default : UnitTest
8
+ - name : OtherBuildTarget
9
+ displayName : ' Build which target for Debug/CodeAnalysis?'
10
+ type : string
11
+ values : [ Build, Integration, UnitTest ]
12
+ default : Build
7
13
8
14
variables :
9
- # Build variables
10
- - name : _BuildConfig
11
- value : Release
12
15
- name : DOTNET_CLI_TELEMETRY_OPTOUT
13
16
value : 1
17
+ # Run CodeQL3000 tasks in a separate internal pipeline; not needed here.
18
+ - name : Codeql.SkipTaskAutoInjection
19
+ value : true
14
20
15
21
trigger : [main]
16
22
pr : ['*']
20
26
displayName : Build
21
27
pool :
22
28
${{ if eq(variables['System.TeamProject'], 'public') }} :
23
- name : NetCore-Svc- Public
29
+ name : NetCore-Public
24
30
demands : ImageOverride -equals windows.vs2017.amd64.open
25
31
${{ else }} :
26
32
name : NetCore1ESPool-Internal
@@ -30,34 +36,58 @@ jobs:
30
36
strategy :
31
37
matrix :
32
38
Release :
39
+ _BuildTarget : ${{ parameters.ReleaseBuildTarget }}
33
40
_Configuration : Release
34
41
_StyleCopEnabled : true
42
+ # Do CG work only in internal pipelines.
43
+ skipComponentGovernanceDetection : ${{ eq(variables['System.TeamProject'], 'public') }}
35
44
Debug :
45
+ _BuildTarget : ${{ parameters.OtherBuildTarget }}
36
46
_Configuration : Debug
37
47
_StyleCopEnabled : false
48
+ # Do not redo CG work. Configuration changes in this part of the matrix are not relevant to CG.
49
+ skipComponentGovernanceDetection : true
38
50
CodeAnalysis :
51
+ _BuildTarget : ${{ parameters.OtherBuildTarget }}
39
52
_Configuration : CodeAnalysis
40
53
_StyleCopEnabled : false
54
+ # Do not redo CG work. Configuration changes in this part of the matrix are not relevant to CG.
55
+ skipComponentGovernanceDetection : true
56
+
41
57
steps :
58
+ - checkout : self
59
+ clean : true
60
+ displayName : Checkout
42
61
- task : UseDotNet@2
62
+ displayName : Get .NET SDK
43
63
inputs :
44
64
useGlobalJson : true
45
65
46
66
- script : .\build.cmd EnableSkipStrongNames
47
67
displayName : Windows Build - EnableSkipStrongNames
48
-
49
- - script : .\build.cmd ${{ parameters.BuildTarget }} /p:Desktop=false /p:BuildPortable=true ^
68
+ - script : .\build.cmd $(_BuildTarget) /p:Desktop=false /p:BuildPortable=true ^
50
69
/binaryLogger:artifacts/msbuild.binlog /p:Configuration=$(_Configuration) /p:StyleCopEnabled=$(_StyleCopEnabled) ^
51
70
/flp:LogFile=artifacts/msbuild.log
52
71
displayName : Windows Build
53
72
54
- - ${{ if ne(parameters.BuildTarget , 'Build') }} :
73
+ - ${{ if ne('$(_BuildTarget)' , 'Build') }} :
55
74
- publish : ./bin/$(_Configuration)/Test/TestResults/
56
- artifact : $(Agent.JobName ) Test Results
75
+ artifact : $(_Configuration ) Test Results
57
76
condition : always()
58
77
continueOnError : true
59
78
displayName : Upload test results
79
+ - task : PublishTestResults@2
80
+ condition : always()
81
+ continueOnError : true
82
+ displayName : Publish test results
83
+ inputs :
84
+ configuration : $(_Configuration)
85
+ mergeTestResults : true
86
+ searchFolder : ./bin/$(_Configuration)/Test/TestResults/
87
+ testResultsFiles : ' *.xml'
88
+ testRunner : xUnit
89
+
60
90
- publish : ./artifacts/
61
- artifact : $(Agent.JobName ) Logs
91
+ artifact : $(_Configuration ) Logs
62
92
condition : always()
63
93
displayName : Upload logs
0 commit comments