Skip to content

Commit b8be3f7

Browse files
committed
prepare modules on generation branch
1 parent d37ef02 commit b8be3f7

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.azure-pipelines/PipelineSteps/BatchGeneration/filter.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $artifactsDir = Join-Path $RepoRoot 'artifacts'
1515

1616
$changedModulesDict = @{}
1717
$changedSubModulesDict = @{}
18-
if ($env:TEST_CHANGED_MODULES_ONLY -eq "True") {
18+
if ($env:TEST_CHANGED_MODULES_ONLY -eq 'true') {
1919
Write-Host "Run test on generated folder changed modules"
2020
# Only generated folder change should trigger the test
2121
for ($i = 0; $i -lt $ChangedFiles.Count; $i++) {

.azure-pipelines/batch-generation.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
parameters:
22
- name: TestChangedModulesOnly
3-
type: string
4-
default: 'True'
3+
type: boolean
4+
default: true
5+
# Selected modules to generate, build, analyze and test
56
- name: SelectedTargetModules
67
type: string
78
default: 'None'
89
- name: NotificationReceiversOverride
910
type: string
1011
default: 'None'
12+
# branch from when creating the generation branch
1113
- name: GenerationBaseBranch
1214
type: string
1315
default: 'main'
16+
- name: PrepareModulesOnGenerationBranch
17+
type: boolean
18+
default: false
1419

1520
variables:
1621
IntermediateStepTimeoutInMinutes: 30
@@ -61,6 +66,7 @@ stages:
6166
Write-Host "Parameter SelectedTargetModules: ${{ parameters.SelectedTargetModules }}"
6267
Write-Host "Parameter NotificationReceiversOverride: ${{ parameters.NotificationReceiversOverride }}"
6368
Write-Host "Parameter GenerationBaseBranch: ${{ parameters.GenerationBaseBranch }}"
69+
Write-Host "Parameter PrepareModulesOnGenerationBranch: ${{ parameters.PrepareModulesOnGenerationBranch }}"
6470
6571
# TODO: (Bernard) Uncomment the no checkout step after automatically install repo into agents
6672
# - checkout: none
@@ -105,9 +111,11 @@ stages:
105111
targetType: inline
106112
pwsh: true
107113
script: |
108-
Write-Host "Checkout to GenerationBranch: $(checkout.GenerationBranch)"
109-
git fetch origin "$(checkout.GenerationBranch)"
110-
git checkout "$(checkout.GenerationBranch)"
114+
if (${{ parameters.PrepareModulesOnGenerationBranch }} -eq 'true') {
115+
Write-Host "Checkout to GenerationBranch: $(checkout.GenerationBranch)"
116+
git fetch origin "$(checkout.GenerationBranch)"
117+
git checkout "$(checkout.GenerationBranch)"
118+
}
111119
112120
$prepareModulesPath = Join-Path "$(Build.SourcesDirectory)" '.azure-pipelines' 'PipelineSteps' 'BatchGeneration' 'prepare.ps1'
113121
& $prepareModulesPath -RepoRoot "$(Build.SourcesDirectory)" -MaxParallelJobs "${{ variables.MaxParallelGenerateJobs }}"

0 commit comments

Comments
 (0)