Skip to content

Commit

Permalink
[Matrix-Generation] Support additional customized steps before matrix…
Browse files Browse the repository at this point in the history
… generation (#2913)

* archetype-sdk-tests-generate.yml now provides an opportunity for additional steps after the target has been cloned but before matrix generation is invoked
  • Loading branch information
scbedd authored Mar 15, 2022
1 parent 80fc220 commit 07ec711
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ parameters:
- name: GenerateJobName
type: string
default: 'generate_job_matrix'
- name: PreGenerationSteps
type: stepList
default: []

jobs:
- job: ${{ parameters.GenerateJobName }}
Expand All @@ -58,6 +61,8 @@ jobs:
Paths:
- "sdk/${{ parameters.AdditionalParameters.ServiceDirectory }}"

- ${{ parameters.PreGenerationSteps }}

- ${{ each config in parameters.MatrixConfigs }}:
- ${{ if eq(config.GenerateVMJobs, 'true') }}:
- task: Powershell@2
Expand Down
5 changes: 5 additions & 0 deletions eng/common/scripts/job-matrix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ jobs:
Cloud: Public
MatrixFilters: []
MatrixReplace: []
PreGenerationSteps: []
```

### A note regarding PreGenerationSteps

The generation template laid out above runs as its own job. A limitation of this method is that it disallows any runtime matrix customization due to the fact that an individual job clones the targeted build SHA. The stepList `PreGenerationSteps` allows users to update matrix json however they like prior to actually invoking the matrix generation. Injected steps are run after the repository checkout, but before any matrix generation is invoked.

## Matrix config file syntax

Matrix parameters can either be a list of strings, or a set of grouped strings (represented as a hash). The latter parameter
Expand Down

0 comments on commit 07ec711

Please sign in to comment.