Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI display names to tasks - Fixes #63 #65

Merged
merged 3 commits into from
Jan 10, 2020
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
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
43 changes: 32 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,19 +63,22 @@ 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'
testRunTitle: 'HQRM'
condition: succeededOrFailed()

- job: Test_Unit
displayName: 'Unit'
pool:
vmImage: 'win1803'
timeoutInMinutes: 0
Expand All @@ -78,7 +87,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 +96,61 @@ 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
displayName: '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 +169,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 @@ -174,7 +194,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