Skip to content

Commit

Permalink
[Ignore] Split AzDO jobs + refactor into templates (#940)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmholt authored Apr 18, 2019
1 parent 2df8043 commit 0ba7868
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 25 deletions.
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

0 comments on commit 0ba7868

Please sign in to comment.