Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions tools/devops/automation/templates/common/archive-html-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Remove empty directories, archive the Html Report, and publish it as a pipeline artifact.
parameters:

- name: rootFolder
type: string

- name: artifactName
type: string

steps:

# Remove empty directories before archiving.
- pwsh: |
$root = "${{ parameters.rootFolder }}"
if (Test-Path $root) {
Get-ChildItem $root -Recurse -Force -Directory |
Sort-Object -Property FullName -Descending |
Where-Object { ($_ | Get-ChildItem -Force | Select-Object -First 1).Count -eq 0 } |
ForEach-Object {
Write-Host "Removing empty directory: $($_.FullName)"
Remove-Item -Force $_
Comment thread
rolfbjarne marked this conversation as resolved.
}
}
displayName: 'Remove empty directories from HtmlReport'
continueOnError: true
condition: succeededOrFailed()

# Archive files for the Html Report so that the report can be easily uploaded as artifacts of the build.
- task: ArchiveFiles@1
displayName: 'Archive HtmlReport'
inputs:
rootFolder: '${{ parameters.rootFolder }}'
includeRootFolder: false
archiveFile: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
continueOnError: true
condition: succeededOrFailed()

# Create HtmlReport artifact. This serves two purposes:
# 1. It is the way we are going to share the HtmlReport with the publish_html job that is executed on a Windows machine.
# 2. Users can download this if they want.
- task: PublishPipelineArtifact@1
displayName: 'Publish Artifact: HtmlReport'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
artifactName: '${{ parameters.artifactName }}'
continueOnError: true
condition: succeededOrFailed()
17 changes: 2 additions & 15 deletions tools/devops/automation/templates/mac/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,22 +223,9 @@ steps:
continueOnError: true
condition: succeededOrFailed()

# Archive files for the Html Report so that the report can be easily uploaded as artifacts of the build.
- task: ArchiveFiles@1
displayName: 'Archive HtmlReport'
inputs:
- template: ../common/archive-html-report.yml
parameters:
rootFolder: '$(BUILD_REPOSITORY_TITLE)/jenkins-results'
includeRootFolder: false
archiveFile: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
continueOnError: true
condition: succeededOrFailed()

- task: PublishPipelineArtifact@1
displayName: 'Publish Artifact: HtmlReport'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
artifactName: '${{ parameters.uploadPrefix }}HtmlReport-${{ parameters.stageName }}${{ parameters.label }}-$(System.JobAttempt)'
continueOnError: true
condition: succeededOrFailed()


20 changes: 2 additions & 18 deletions tools/devops/automation/templates/tests/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,26 +217,10 @@ steps:
continueOnError: true
condition: and(ne(variables['VSTS_XML_FILES'], 0), succeededOrFailed())

# Archive files for the Html Report so that the report can be easily uploaded as artifacts of the build.
- task: ArchiveFiles@1
displayName: 'Archive HtmlReport'
inputs:
- template: ../common/archive-html-report.yml
parameters:
rootFolder: '$(BUILD_REPOSITORY_TITLE)/jenkins-results'
includeRootFolder: false
archiveFile: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
continueOnError: true
condition: succeededOrFailed()

# Create HtmlReport artifact. This serves two purposes:
# 1. It is the way we are going to share the HtmlReport with the publish_html job that is executed on a Windows machine.
# 2. Users can download this if they want.
- task: PublishPipelineArtifact@1
displayName: 'Publish Artifact: HtmlReport'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
artifactName: '${{ parameters.uploadPrefix }}HtmlReport-${{ parameters.testPrefix }}-$(System.JobAttempt)'
continueOnError: true
condition: succeededOrFailed()

# Upload all the binlogs
# Copy all the binlogs to a separate directory, keeping directory structure.
Expand Down
20 changes: 2 additions & 18 deletions tools/devops/automation/templates/windows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,26 +357,10 @@ steps:
continueOnError: true
condition: succeededOrFailed()

# Archive files for the Html Report so that the report can be easily uploaded as artifacts of the build.
- task: ArchiveFiles@1
displayName: 'Archive HtmlReport'
inputs:
- template: ../common/archive-html-report.yml
parameters:
rootFolder: '$(Build.SourcesDirectory)/$(BUILD_REPOSITORY_TITLE)/jenkins-results'
includeRootFolder: false
archiveFile: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
continueOnError: true
condition: succeededOrFailed()

# Create HtmlReport artifact. This serves two purposes:
# 1. It is the way we are going to share the HtmlReport with the publish_html job that is executed on a Windows machine.
# 2. Users can download this if they want.
- task: PublishPipelineArtifact@1
displayName: 'Publish Artifact: HtmlReport'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
artifactName: '${{ parameters.uploadPrefix }}HtmlReport-windows_integrationwindows-$(System.JobAttempt)'
continueOnError: true
condition: succeededOrFailed()

- pwsh: |
Write-Host "Run windows tests."
Expand Down
Loading