forked from Azure/azure-sdk-for-js
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync eng/common directory with azure-sdk-tools for PR 1452 (Azure#14179)
* Use sparse checkout for generate matrix job * Add repository parameter Co-authored-by: Ben Broderick Phillips <[email protected]>
- Loading branch information
Showing
3 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
parameters: | ||
- name: Paths | ||
type: object | ||
default: [] | ||
- name: Repositories | ||
type: object | ||
default: | ||
- Name: $(Build.Repository.Name) | ||
Commitish: $(Build.SourceVersion) | ||
WorkingDirectory: $(System.DefaultWorkingDirectory) | ||
|
||
steps: | ||
- checkout: none | ||
|
||
- ${{ each repo in parameters.Repositories }}: | ||
- pwsh: | | ||
$dir = "${{ coalesce(repo.WorkingDirectory, format('{0}/{1}', '$(System.DefaultWorkingDirectory)', repo.Name)) }}" | ||
New-Item $dir -ItemType Directory -Force | ||
- pwsh: | | ||
git clone --no-checkout --filter=tree:0 git://github.com/${{ repo.Name }} . | ||
git sparse-checkout init | ||
git sparse-checkout set eng | ||
displayName: Init sparse checkout ${{ repo.Name }} | ||
workingDirectory: ${{ coalesce(repo.WorkingDirectory, format('{0}/{1}', '$(System.DefaultWorkingDirectory)', repo.Name)) }} | ||
- ${{ each path in parameters.Paths }}: | ||
- pwsh: git sparse-checkout add ${{ path }} | ||
displayName: Add sparse checkout path ${{ path }} | ||
workingDirectory: ${{ coalesce(repo.WorkingDirectory, format('{0}/{1}', '$(System.DefaultWorkingDirectory)', repo.Name)) }} | ||
|
||
- pwsh: git checkout ${{ repo.Commitish }} | ||
displayName: Sparse checkout at ${{ repo.Commitish }} | ||
workingDirectory: ${{ coalesce(repo.WorkingDirectory, format('{0}/{1}', '$(System.DefaultWorkingDirectory)', repo.Name)) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters