Skip to content

Commit 0ba7868

Browse files
authored
[Ignore] Split AzDO jobs + refactor into templates (#940)
1 parent 2df8043 commit 0ba7868

File tree

3 files changed

+54
-25
lines changed

3 files changed

+54
-25
lines changed

.vsts-ci/azure-pipelines-ci.yml

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,64 @@
1-
trigger:
2-
- master
3-
- legacy/1.x
1+
name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr)
2+
43
variables:
5-
# Don't download unneeded packages
4+
# Don't download unneeded packages
65
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
76
value: 'true'
8-
# Don't send telemetry
7+
# Improve performance by not sending telemetry
98
- name: DOTNET_CLI_TELEMETRY_OPTOUT
109
value: 'true'
10+
11+
trigger:
12+
batch: true
13+
branches:
14+
include:
15+
- master
16+
- legacy/1.x
17+
paths:
18+
exclude:
19+
- /.dependabot/*
20+
- /.poshchan/*
21+
- /.github/**/*
22+
- /.vscode/**/*
23+
- /.vsts-ci/misc-analysis.yml
24+
- /tools/**/*
25+
- .editorconfig
26+
- .gitattributes
27+
- .gitignore
28+
- /docs/**/*
29+
- /CHANGELOG.md
30+
- /CONTRIBUTING.md
31+
- /README.md
32+
- /LICENSE
33+
- /CODE_OF_CONDUCT.md
34+
1135
jobs:
12-
- job: Windows_powershell
36+
- job: 'PS51_Win10'
37+
displayName: PowerShell 5.1 | Windows 10
1338
pool:
14-
vmImage: 'VS2017-Win2016'
39+
vmImage: 'vs2017-win2016'
1540
steps:
16-
- powershell: scripts/azurePipelinesBuild.ps1
17-
- task: PublishTestResults@2
18-
inputs:
19-
testRunner: VSTest
20-
testResultsFiles: '**/*.trx'
21-
condition: succeededOrFailed()
22-
- task: PublishBuildArtifacts@1
23-
inputs:
24-
ArtifactName: PowerShellEditorServices
25-
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
26-
41+
- template: templates/ci-general.yml
42+
parameters:
43+
pwsh: false
2744

28-
- job: Windows_pwsh
45+
- job: 'PS6_Win10'
46+
displayName: PowerShell 6 | Windows 10
2947
pool:
30-
vmImage: 'VS2017-Win2016'
48+
vmImage: 'vs2017-win2016'
3149
steps:
3250
- template: templates/ci-general.yml
3351

34-
- job: macOS
52+
- job: 'PS6_macOS'
53+
displayName: PowerShell 6 | macOS
3554
pool:
3655
vmImage: 'macOS-10.13'
3756
steps:
3857
- template: templates/ci-general.yml
3958

40-
- job: Linux
59+
- job: 'PS6_Ubuntu'
60+
displayName: PowerShell 6 | Ubuntu
4161
pool:
42-
vmImage: 'Ubuntu-16.04'
62+
vmImage: 'ubuntu-16.04'
4363
steps:
4464
- template: templates/ci-general.yml

.vsts-ci/templates/ci-general.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
parameters:
2+
pwsh: true
3+
14
steps:
2-
- pwsh: scripts/azurePipelinesBuild.ps1
5+
- pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))"
6+
displayName: Set Build Name for Non-PR
7+
condition: ne(variables['Build.Reason'], 'PullRequest')
8+
- task: PowerShell@2
9+
inputs:
10+
filePath: scripts/azurePipelinesBuild.ps1
11+
pwsh: ${{ parameters.pwsh }}
312
- task: PublishTestResults@2
413
inputs:
514
testRunner: VSTest

PowerShellEditorServices.build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ task GetProductVersion -Before PackageNuGet, PackageModule, UploadArtifacts {
268268
# SYSTEM_PHASENAME is the Job name.
269269
# Job names can only include `_` but that's not a valid character for versions.
270270
$jobname = $env:SYSTEM_PHASENAME -replace '_', ''
271-
$script:BuildNumber = "$jobname-$env:BUILD_BUILDNUMBER"
271+
$script:BuildNumber = "$jobname-$env:BUILD_BUILDID"
272272
}
273273

274274
if ($script:VersionSuffix -ne $null) {

0 commit comments

Comments
 (0)