Sync eng/common directory with azure-sdk-tools for PR 2913 (#3433)

* archetype-sdk-tests-generate.yml now provides an opportunity for additional steps after the target has been cloned but before matrix generation is invoked

Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
This commit is contained in:
Azure SDK Bot 2022-03-15 13:21:23 -07:00 committed by GitHub
parent a46b15c8af
commit c930b56100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -36,6 +36,9 @@ parameters:
- name: GenerateJobName
type: string
default: 'generate_job_matrix'
- name: PreGenerationSteps
type: stepList
default: []
jobs:
- job: ${{ parameters.GenerateJobName }}
@ -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

View File

@ -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