forked from haoduotnt/aspnetwebstack
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-pipelines.yml
94 lines (86 loc) · 3.01 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
82
83
84
85
86
87
88
89
90
91
92
93
94
parameters:
# Test only the Release build by default.
- name: ReleaseBuildTarget
displayName: 'Build which target for Release?'
type: string
values: [ Build, Integration, UnitTest ]
default: UnitTest
- name: OtherBuildTarget
displayName: 'Build which target for Debug/CodeAnalysis?'
type: string
values: [ Build, Integration, UnitTest ]
default: Build
variables:
- name: DOTNET_CLI_TELEMETRY_OPTOUT
value: 1
- name: DOTNET_NOLOGO
value: 1
# Run CodeQL3000 tasks in a separate internal pipeline; not needed here.
- name: Codeql.SkipTaskAutoInjection
value: true
trigger: [main]
pr: ['*']
jobs:
- job: build
displayName: Build
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: NetCore-Public
demands: ImageOverride -equals windows.vs2019.amd64.open
${{ else }}:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals windows.vs2019.amd64
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
- script: .\build.cmd EnableSkipStrongNames
displayName: Enable SkipStrongNames
- script: .\build.cmd $(_BuildTarget) /p:BuildPortable=true ^
/binaryLogger:artifacts/msbuild.binlog /p:Configuration=$(_Configuration) /p:StyleCopEnabled=$(_StyleCopEnabled) ^
/fileLoggerParameters:LogFile=artifacts/msbuild.log;Summary;Verbosity=minimal
displayName: Build
- publish: ./bin/$(_Configuration)/Test/TestResults/
artifact: $(_Configuration) Test Results
condition: and(always(), ne(variables._BuildTarget, 'Build'))
continueOnError: true
displayName: Upload test results
- 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)
- publish: ./artifacts/
artifact: $(_Configuration) Logs
condition: always()
displayName: Upload logs