Skip to content

Commit

Permalink
Add CI display names to tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
PlagueHO committed Jan 8, 2020
1 parent f7c414a commit 70c6c9a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Changed `azure-pipeline.yml` to match current pattern ([Issue #59](https://github.com/dsccommunity/WSManDsc/issues/59)).
- 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 #63](https://github.com/PowerShell/WSManDsc/issues/63)

### Deprecated

Expand Down
41 changes: 30 additions & 11 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,30 @@ pr:
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 @@ -44,11 +48,13 @@ stages:
dependsOn: Build
jobs:
- job: Test_HQRM
displayName: 'HQRM'
pool:
vmImage: 'win1803'
timeoutInMinutes: 0
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifact'
inputs:
buildType: 'current'
downloadType: 'single'
Expand All @@ -57,12 +63,14 @@ stages:

- task: PowerShell@2
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'
Expand All @@ -78,7 +86,7 @@ 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
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
Expand All @@ -87,53 +95,60 @@ stages:
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'
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
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 @@ -152,19 +167,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: publishPrerelease
displayName: 'Publish Prerelease'
inputs:
filePath: './build.ps1'
arguments: '-tasks publish'
Expand All @@ -174,7 +192,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 70c6c9a

Please sign in to comment.