Skip to content

Split AzDO jobs + refactor into templates #940

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

Merged
merged 20 commits into from
Apr 18, 2019
66 changes: 43 additions & 23 deletions .vsts-ci/azure-pipelines-ci.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,64 @@
trigger:
- master
- legacy/1.x
name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr)

variables:
# Don't download unneeded packages
# Don't download unneeded packages
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: 'true'
# Don't send telemetry
# Improve performance by not sending telemetry
- name: DOTNET_CLI_TELEMETRY_OPTOUT
value: 'true'

trigger:
batch: true
branches:
include:
- master
- legacy/1.x
paths:
exclude:
- /.dependabot/*
- /.poshchan/*
- /.github/**/*
- /.vscode/**/*
- /.vsts-ci/misc-analysis.yml
- /tools/**/*
- .editorconfig
- .gitattributes
- .gitignore
- /docs/**/*
- /CHANGELOG.md
- /CONTRIBUTING.md
- /README.md
- /LICENSE
- /CODE_OF_CONDUCT.md

jobs:
- job: Windows_powershell
- job: 'PS51_Win10'
displayName: PowerShell 5.1 | Windows 10
pool:
vmImage: 'VS2017-Win2016'
vmImage: 'vs2017-win2016'
steps:
- powershell: scripts/azurePipelinesBuild.ps1
- task: PublishTestResults@2
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
inputs:
ArtifactName: PowerShellEditorServices
PathtoPublish: '$(Build.ArtifactStagingDirectory)'

- template: templates/ci-general.yml
parameters:
pwsh: false

- job: Windows_pwsh
- job: 'PS6_Win10'
displayName: PowerShell 6 | Windows 10
pool:
vmImage: 'VS2017-Win2016'
vmImage: 'vs2017-win2016'
steps:
- template: templates/ci-general.yml

- job: macOS
- job: 'PS6_macOS'
displayName: PowerShell 6 | macOS
pool:
vmImage: 'macOS-10.13'
steps:
- template: templates/ci-general.yml

- job: Linux
- job: 'PS6_Ubuntu'
displayName: PowerShell 6 | Ubuntu
pool:
vmImage: 'Ubuntu-16.04'
vmImage: 'ubuntu-16.04'
steps:
- template: templates/ci-general.yml
11 changes: 10 additions & 1 deletion .vsts-ci/templates/ci-general.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
parameters:
pwsh: true

steps:
- pwsh: scripts/azurePipelinesBuild.ps1
- pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))"
displayName: Set Build Name for Non-PR
condition: ne(variables['Build.Reason'], 'PullRequest')
- task: PowerShell@2
inputs:
filePath: scripts/azurePipelinesBuild.ps1
pwsh: ${{ parameters.pwsh }}
- task: PublishTestResults@2
inputs:
testRunner: VSTest
Expand Down
2 changes: 1 addition & 1 deletion PowerShellEditorServices.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ task GetProductVersion -Before PackageNuGet, PackageModule, UploadArtifacts {
# SYSTEM_PHASENAME is the Job name.
# Job names can only include `_` but that's not a valid character for versions.
$jobname = $env:SYSTEM_PHASENAME -replace '_', ''
$script:BuildNumber = "$jobname-$env:BUILD_BUILDNUMBER"
$script:BuildNumber = "$jobname-$env:BUILD_BUILDID"
}

if ($script:VersionSuffix -ne $null) {
Expand Down