Skip to content

Commit

Permalink
Update CI pipeline files (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju authored Jan 6, 2020
1 parent 8d9e190 commit c54daed
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 28 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- GPRegistryPolicyDsc
- Update GitVersion.yml with the correct regular expression.

### Changed

- GPRegistryPolicyDsc
- Set a display name on all the jobs and tasks in the CI pipeline.

## [1.1.0] - 2020-01-05

### Added
Expand Down
16 changes: 2 additions & 14 deletions GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,14 @@ branches:
feature:
tag: useBranchName
increment: Minor
regex: f(eature(s)?)?[/-]
regex: f(eature(s)?)?[\/-]
source-branches: ['master']
hotfix:
tag: fix
increment: Patch
regex: (hot)?fix(es)?[/-]
regex: (hot)?fix(es)?[\/-]
source-branches: ['master']

ignore:
sha: []
merge-message-formats: {}


# feature:
# tag: useBranchName
# increment: Minor
# regex: f(eature(s)?)?[/-]
# source-branches: ['master']
# hotfix:
# tag: fix
# increment: Patch
# regex: (hot)?fix(es)?[/-]
# source-branches: ['master']
50 changes: 36 additions & 14 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,28 @@ trigger:
stages:
- stage: Build
jobs:
- job: BuildModuleJob
- job: Package_Module
displayName: 'Package Module'
pool:
vmImage: 'ubuntu 16.04'
steps:
- task: GitVersion@5
name: gitversion
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: '-ResolveDependency -tasks pack'
pwsh: true
env:
ModuleVersion: $(GitVersion.Informationalversion)

ModuleVersion: $(gitVersion.InformationalVersion)
- task: PublishBuildArtifacts@1
displayName: 'Publish Build Artifact'
inputs:
PathtoPublish: 'output/'
ArtifactName: 'output'
Expand All @@ -39,30 +42,35 @@ 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'
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'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testRunTitle: 'HQRM'

- job: Test_Unit
displayName: 'Unit'
pool:
vmImage: 'win1803'
timeoutInMinutes: 0
Expand All @@ -71,56 +79,66 @@ 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'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: 'output/testResults/NUnit*.xml'
testRunTitle: 'Unit (Windows Server Core)'
- 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: 'win1803'
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'
condition: succeededOrFailed()
inputs:
testResultsFormat: 'NUnit'
Expand All @@ -138,18 +156,21 @@ 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 @@ -158,7 +179,8 @@ stages:
GitHubToken: $(GitHubToken)
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 c54daed

Please sign in to comment.