Skip to content

Commit

Permalink
Merge pull request #664 from PlagueHO/Issue-663
Browse files Browse the repository at this point in the history
Add Display Name to all CI Tasks - Fixes #663
  • Loading branch information
PlagueHO authored Jan 10, 2020
2 parents d002c9a + baf0465 commit 98c64f6
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[issue #656](https://github.com/PowerShell/xPSDesiredStateConfiguration/issues/656).
- Set `testRunTitle` for PublishTestResults steps so that a helpful name is
displayed in Azure DevOps for each test run.
- Set a display name on all the jobs and tasks in the CI
pipeline - fixes [issue #663](https://github.com/PowerShell/xPSDesiredStateConfiguration/issues/663).

### Deprecated

Expand Down
66 changes: 50 additions & 16 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,30 @@ trigger:
stages:
- stage: Build
jobs:
- job: BuildModuleJob
- job: Package_Module
displayName: 'Package Module'
pool:
vmImage: 'ubuntu 16.04'
steps:
- task: GitVersion@5
name: gitversion
displayName: 'Evaluate Next Version'
inputs:
runtime: 'core'
configFilePath: 'GitVersion.yml'

- task: PowerShell@2
name: Build
name: package
displayName: 'Build & Package Module'
inputs:
filePath: './build.ps1'
arguments: '-Tasks pack -ResolveDependency'
pwsh: true
env:
ModuleVersion: $(GitVersion.Informationalversion)
ModuleVersion: $(gitVersion.Informationalversion)

- task: PublishBuildArtifacts@1
displayName: 'Publish Build Artifact'
inputs:
PathtoPublish: 'output/'
ArtifactName: 'output'
Expand All @@ -40,32 +44,37 @@ stages:
dependsOn: Build
jobs:
- job: Test_HQRM
displayName: 'HQRM'
pool:
vmImage: 'windows-2019'
timeoutInMinutes: 0
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'

- task: PowerShell@2
name: Test
name: test
displayName: 'Run HQRM Test'
inputs:
filePath: './build.ps1'
arguments: '-Tasks hqrmtest'
pwsh: false

- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testRunTitle: 'HQRM'
condition: succeededOrFailed()

- job: Test_Unit_2016
displayName: 'Unit (Windows Server 2016)'
pool:
vmImage: 'vs2017-win2016'
timeoutInMinutes: 0
Expand All @@ -74,70 +83,81 @@ stages:
$repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/'
echo "##vso[task.setvariable variable=RepositoryOwner;isOutput=true]$repositoryOwner"
echo "##vso[task.setvariable variable=RepositoryName;isOutput=true]$repositoryName"
name: DscBuildVariable
name: dscBuildVariable
displayName: 'Set Environment Variables'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'

- task: PowerShell@2
name: Test
name: test
displayName: 'Run Unit Test'
inputs:
filePath: './build.ps1'
arguments: "-Tasks test -PesterScript 'tests/Unit'"
pwsh: false

- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testRunTitle: 'Unit (Windows Server 2016)'
condition: succeededOrFailed()

- task: PublishCodeCoverageResults@1
displayName: 'Publish Code Coverage'
condition: succeededOrFailed()
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: 'output/testResults/CodeCov*.xml'
pathToSources: '$(Build.SourcesDirectory)/output/$(DscBuildVariable.RepositoryName)'

- job: Test_Integration_2016
displayName: 'Integration (Windows Server 2016)'
pool:
vmImage: 'vs2017-win2016'
timeoutInMinutes: 0
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'

- task: PowerShell@2
name: ConfigureWinRM
name: configureWinRM
displayName: 'Configure WinRM'
inputs:
targetType: 'inline'
script: 'winrm quickconfig -quiet'
pwsh: false

- task: PowerShell@2
name: Test
name: test
displayName: 'Run Integration Test'
inputs:
filePath: './build.ps1'
arguments: "-Tasks test -PesterScript 'tests/Integration' -CodeCoverageThreshold 0"
pwsh: false

- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testRunTitle: 'Integration (Windows Server 2016)'
condition: succeededOrFailed()

- job: Test_Unit_2019
displayName: 'Unit (Windows Server 2019)'
pool:
vmImage: 'windows-2019'
timeoutInMinutes: 0
Expand All @@ -146,63 +166,73 @@ stages:
$repositoryOwner,$repositoryName = $env:BUILD_REPOSITORY_NAME -split '/'
echo "##vso[task.setvariable variable=RepositoryOwner;isOutput=true]$repositoryOwner"
echo "##vso[task.setvariable variable=RepositoryName;isOutput=true]$repositoryName"
name: DscBuildVariable
name: dscBuildVariable
displayName: 'Set Environment Variables'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'

- task: PowerShell@2
name: Test
name: test
displayName: 'Run Unit Test'
inputs:
filePath: './build.ps1'
arguments: "-Tasks test -PesterScript 'tests/Unit'"
pwsh: false

- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testRunTitle: 'Unit (Windows Server 2019)'
condition: succeededOrFailed()

- task: PublishCodeCoverageResults@1
displayName: 'Publish Code Coverage'
condition: succeededOrFailed()
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: 'output/testResults/CodeCov*.xml'
pathToSources: '$(Build.SourcesDirectory)/output/$(DscBuildVariable.RepositoryName)'
pathToSources: '$(Build.SourcesDirectory)/output/$(dscBuildVariable.RepositoryName)'

- job: Test_Integration_2019
displayName: 'Integration (Windows Server 2019)'
pool:
vmImage: 'windows-2019'
timeoutInMinutes: 0
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'

- task: PowerShell@2
name: ConfigureWinRM
name: configureWinRM
displayName: 'Configure WinRM'
inputs:
targetType: 'inline'
script: 'winrm quickconfig -quiet'
pwsh: false

- task: PowerShell@2
name: Test
name: test
displayName: 'Run Integration Test'
inputs:
filePath: './build.ps1'
arguments: "-Tasks test -PesterScript 'tests/Integration' -CodeCoverageThreshold 0"
pwsh: false

- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
Expand All @@ -221,19 +251,22 @@ stages:
)
)
jobs:
- job: Deploy_Artefact
- job: Deploy_Module
displayName: 'Deploy Module'
pool:
vmImage: 'ubuntu 16.04'
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'output'
downloadPath: '$(Build.SourcesDirectory)'

- task: PowerShell@2
name: publish_prerelease
name: publishRelease
displayName: 'Publish Release'
inputs:
filePath: './build.ps1'
arguments: '-tasks publish'
Expand All @@ -243,7 +276,8 @@ stages:
GalleryApiToken: $(GalleryApiToken)

- task: PowerShell@2
name: send_changelog_PR
name: sendChangelogPR
displayName: 'Send Changelog PR'
inputs:
filePath: './build.ps1'
arguments: '-tasks Create_ChangeLog_GitHub_PR'
Expand Down

0 comments on commit 98c64f6

Please sign in to comment.