Skip to content

Commit

Permalink
Merge pull request #2576 from dotnet/logs_in_ci
Browse files Browse the repository at this point in the history
Enabling publishing logs and test results for CI as well as for official builds.
  • Loading branch information
Livar authored Oct 11, 2018
2 parents b2a37cf + ab978b9 commit 99909b3
Showing 1 changed file with 28 additions and 29 deletions.
57 changes: 28 additions & 29 deletions eng/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ phases:
queue: ${{ parameters.queue }}
variables:
${{ insert }}: ${{ parameters.variables }}
_AgentOSName: ${{ parameters.agentOs }}
_HelixType: build/product
_HelixBuildConfig: $(_BuildConfig)
_TeamName: DotNetCore
Expand Down Expand Up @@ -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()

0 comments on commit 99909b3

Please sign in to comment.