From ab978b9a0841510f1008add9ce6ac67d216c4c29 Mon Sep 17 00:00:00 2001 From: Livar Cunha Date: Wed, 10 Oct 2018 10:18:53 -0700 Subject: [PATCH] Enabling publishing logs and test results for CI as well as for official builds. --- eng/build.yml | 57 +++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/eng/build.yml b/eng/build.yml index 8309a29068..32ff5bc1eb 100644 --- a/eng/build.yml +++ b/eng/build.yml @@ -13,6 +13,7 @@ phases: queue: ${{ parameters.queue }} variables: ${{ insert }}: ${{ parameters.variables }} + _AgentOSName: ${{ parameters.agentOs }} _HelixType: build/product _HelixBuildConfig: $(_BuildConfig) _TeamName: DotNetCore @@ -84,34 +85,32 @@ phases: BlobFeedUrl: $(PB_PublishBlobFeedUrl) PublishType: $(_PublishType) - - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: - - task: PublishTestResults@1 - displayName: Publish Test Results - inputs: - testRunner: XUnit - testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml' - testRunTitle: 'Unit Test Results' - platform: '$(BuildPlatform)' - configuration: '$(_BuildConfig)' - condition: and(succeededOrFailed(), ne(variables['PB_SkipTests'], 'true')) + - task: PublishTestResults@1 + displayName: Publish Test Results + inputs: + testRunner: XUnit + testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml' + testRunTitle: 'Unit Test Results' + platform: '$(BuildPlatform)' + configuration: '$(_BuildConfig)' + condition: and(succeededOrFailed(), ne(variables['PB_SkipTests'], 'true')) - - task: CopyFiles@2 - displayName: Stage Build Artifacts - inputs: - SourceFolder: '$(Build.SourcesDirectory)' - Contents: | - artifacts\bin\$(_BuildConfig)\**\* - artifacts\log\$(_BuildConfig)\**\* - artifacts\packages\$(_BuildConfig)\**\* - artifacts\TestResults\$(_BuildConfig)\**\* - TargetFolder: '$(Build.ArtifactStagingDirectory)' - condition: and(succeededOrFailed(), in(variables['_PublishType'], 'drop', 'blob')) + - task: CopyFiles@2 + displayName: Gather Logs + inputs: + SourceFolder: '$(Build.SourcesDirectory)' + Contents: | + artifacts/log/$(_BuildConfig)/**/* + artifacts/TestResults/$(_BuildConfig)/**/* + TargetFolder: '$(Build.ArtifactStagingDirectory)' + continueOnError: true + condition: always() - - task: PublishBuildArtifacts@1 - displayName: Publish Build Artifacts - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\artifacts' - ArtifactName: '$(Build.BuildNumber)' - publishLocation: FilePath - TargetPath: '$(DropRoot)\$(TeamName)\$(Build.DefinitionName)' - condition: and(succeededOrFailed(), in(variables['_PublishType'], 'drop', 'blob')) + - task: PublishBuildArtifacts@1 + displayName: Publish Logs to VSTS + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: '$(_AgentOSName)_$(Agent.JobName)_$(Build.BuildNumber)' + publishLocation: Container + continueOnError: true + condition: always()