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