Skip to content

Commit

Permalink
Fix release-6.6.x pipeline template issue (#6156)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkl authored Nov 22, 2024
1 parent 2fcc929 commit 2d3cc90
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 17 deletions.
40 changes: 23 additions & 17 deletions eng/pipelines/templates/Build_and_UnitTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ parameters:
type: boolean
- name: NuGetLocalizationType
type: string
- name: RunUnitTests
displayName: Run unit tests
type: boolean
default: true

steps:
- task: PowerShell@1
Expand Down Expand Up @@ -147,23 +151,25 @@ steps:
msbuildArguments: "/restore:false /target:CopyFinalNuGetExeToOutputPath /binarylogger:$(Build.StagingDirectory)\\binlog\\06.CopyFinalNuGetExeToOutputPath.binlog"
condition: "and(succeeded(),eq(variables['BuildRTM'], 'false'))"

- task: MSBuild@1
displayName: "Run unit tests (stop on error)"
continueOnError: "false"
inputs:
solution: "build\\build.proj"
configuration: "$(BuildConfiguration)"
msbuildArguments: "/restore:false /target:CoreUnitTests;UnitTestsVS /property:BuildRTM=$(BuildRTM) /property:BuildNumber=$(BuildNumber) /property:SkipILMergeOfNuGetExe=true /binarylogger:$(Build.StagingDirectory)\\binlog\\07.RunUnitTests.binlog"
condition: "and(succeeded(), eq(variables['BuildRTM'], 'true'), not(eq(variables['IsOfficialBuild'], 'true')))"

- task: MSBuild@1
displayName: "Run unit tests (continue on error)"
continueOnError: "true"
inputs:
solution: "build\\build.proj"
configuration: "$(BuildConfiguration)"
msbuildArguments: "/restore:false /target:CoreUnitTests;UnitTestsVS /property:BuildRTM=$(BuildRTM) /property:BuildNumber=$(BuildNumber) /property:SkipILMergeOfNuGetExe=true /binarylogger:$(Build.StagingDirectory)\\binlog\\08.RunUnitTests.binlog"
condition: "and(succeeded(), eq(variables['BuildRTM'], 'true'), eq(variables['IsOfficialBuild'], 'true'))"
- ${{ if eq(parameters.RunUnitTests, true) }}:
- task: MSBuild@1
displayName: "Run unit tests (stop on error)"
continueOnError: "false"
inputs:
solution: "build\\build.proj"
configuration: "$(BuildConfiguration)"
msbuildArguments: "/restore:false /target:CoreUnitTests;UnitTestsVS /property:BuildRTM=$(BuildRTM) /property:BuildNumber=$(BuildNumber) /property:SkipILMergeOfNuGetExe=true /binarylogger:$(Build.StagingDirectory)\\binlog\\07.RunUnitTests.binlog"
condition: "and(succeeded(), eq(variables['BuildRTM'], 'true'), not(eq(variables['IsOfficialBuild'], 'true')))"

- ${{ if eq(parameters.RunUnitTests, true) }}:
- task: MSBuild@1
displayName: "Run unit tests (continue on error)"
continueOnError: "true"
inputs:
solution: "build\\build.proj"
configuration: "$(BuildConfiguration)"
msbuildArguments: "/restore:false /target:CoreUnitTests;UnitTestsVS /property:BuildRTM=$(BuildRTM) /property:BuildNumber=$(BuildNumber) /property:SkipILMergeOfNuGetExe=true /binarylogger:$(Build.StagingDirectory)\\binlog\\08.RunUnitTests.binlog"
condition: "and(succeeded(), eq(variables['BuildRTM'], 'true'), eq(variables['IsOfficialBuild'], 'true'))"

- task: PublishTestResults@2
displayName: "Publish Test Results"
Expand Down
10 changes: 10 additions & 0 deletions eng/pipelines/templates/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ parameters:
displayName: Run functional tests on Windows
type: boolean
default: true
- name: RunUnitTestsOnWindows
displayName: Run unit tests on Windows
type: boolean
default: false
- name: RunSourceBuild
displayName: Run source build
type: boolean
Expand All @@ -37,6 +41,10 @@ parameters:
displayName: Run Mono tests on Mac
type: boolean
default: false
- name: RunStaticAnalysis
displayName: Run static analysis
type: boolean
default: false

stages:
- stage: Initialize
Expand Down Expand Up @@ -70,6 +78,7 @@ stages:
jobs:
- job: RunStaticSourceAnalysis
displayName: Run Static Source Analysis
condition: "ne(variables['RunStaticAnalysis'], 'false')"
timeoutInMinutes: 15
pool:
name: AzurePipelines-EO
Expand Down Expand Up @@ -206,6 +215,7 @@ stages:
parameters:
BuildRTM: false
NuGetLocalizationType: ${{ parameters.NuGetLocalizationType }}
RunUnitTests: ${{ parameters.RunUnitTestsOnWindows }}

- stage: Build_For_Publishing
displayName: Build NuGet published to nuget.org
Expand Down

0 comments on commit 2d3cc90

Please sign in to comment.