Sync eng/common directory with azure-sdk-tools for PR 3874 (#3907)
* Add sparse checkout to perf template * Rename base template, add parameters * Add comment * Add TODO * Fix copy/pase bug, add language to artifacts path * Fix language ref * Fix python language * perf.yml extends perf-base.yml * Remove unnecessary base yml * Fetch pull request refs * Fix refs path * Fetch commitish if matches PR syntax * Print command before running * Add PR commitish to remote.origin.fetch * Add pool and vmimage parameters * Map ref under "refs/remotes/origin" * Add ref to refs/remotes/origin Co-authored-by: Mike Harder <mharder@microsoft.com>
This commit is contained in:
parent
f8c41df5a2
commit
9afb371c79
@ -1,13 +1,37 @@
|
||||
parameters:
|
||||
- name: JobName
|
||||
type: string
|
||||
default: 'Perf'
|
||||
- name: LinuxPool
|
||||
type: string
|
||||
default: 'azsdk-pool-mms-ubuntu-2004-perf'
|
||||
- name: LinuxVmImage
|
||||
type: string
|
||||
default: 'MMSUbuntu20.04'
|
||||
- name: WindowsPool
|
||||
type: string
|
||||
default: 'azsdk-pool-mms-win-2019-perf'
|
||||
- name: WindowsVmImage
|
||||
type: string
|
||||
default: 'MMS2019'
|
||||
- name: Language
|
||||
type: string
|
||||
default: ''
|
||||
- name: LanguageRepoName
|
||||
type: string
|
||||
default: $(Build.Repository.Name)
|
||||
- name: LanguageRepoCommitish
|
||||
type: string
|
||||
default: $(Build.SourceVersion)
|
||||
- name: ToolsRepoCommitish
|
||||
type: string
|
||||
default: 'main'
|
||||
- name: Variables
|
||||
type: object
|
||||
default: []
|
||||
- name: OperatingSystems
|
||||
type: string
|
||||
default: 'Linux'
|
||||
- name: Language
|
||||
type: string
|
||||
default: ''
|
||||
- name: InstallLanguageSteps
|
||||
type: stepList
|
||||
default: []
|
||||
@ -36,41 +60,43 @@ parameters:
|
||||
type: object
|
||||
default: {}
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: azure-sdk-tools
|
||||
type: github
|
||||
endpoint: Azure
|
||||
name: Azure/azure-sdk-tools
|
||||
ref: main
|
||||
|
||||
variables:
|
||||
- ${{ parameters.Variables }}
|
||||
|
||||
jobs:
|
||||
- job: Perf
|
||||
- job: ${{ parameters.JobName }}
|
||||
timeoutInMinutes: 360
|
||||
strategy:
|
||||
matrix:
|
||||
${{ if contains(parameters.OperatingSystems, 'Linux') }}:
|
||||
Linux:
|
||||
Pool: 'azsdk-pool-mms-ubuntu-2004-perf'
|
||||
OsVmImage: 'MMSUbuntu20.04'
|
||||
Pool: ${{ parameters.LinuxPool }}
|
||||
OsVmImage: ${{ parameters.LinuxVmImage }}
|
||||
MatrixName: 'Linux'
|
||||
${{ if contains(parameters.OperatingSystems, 'Windows') }}:
|
||||
Windows:
|
||||
Pool: 'azsdk-pool-mms-win-2019-perf'
|
||||
OsVmImage: 'MMS2019'
|
||||
Pool: ${{ parameters.WindowsPool }}
|
||||
OsVmImage: ${{ parameters.WindowsVmImage }}
|
||||
MatrixName: 'Windows'
|
||||
variables:
|
||||
- ${{ parameters.Variables }}
|
||||
pool:
|
||||
name: $(Pool)
|
||||
vmImage: $(OSVmImage)
|
||||
steps:
|
||||
- checkout: self
|
||||
path: s
|
||||
|
||||
- checkout: azure-sdk-tools
|
||||
path: s/azure-sdk-tools
|
||||
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
|
||||
parameters:
|
||||
Paths:
|
||||
- '/*'
|
||||
- '!sdk/**/test-recordings/*'
|
||||
- '!sdk/**/recordings/*'
|
||||
- '!sdk/**/SessionRecords/*'
|
||||
- '!sdk/**/session-records/*'
|
||||
Repositories:
|
||||
- Name: ${{ parameters.LanguageRepoName }}
|
||||
Commitish: ${{ parameters.LanguageRepoCommitish }}
|
||||
WorkingDirectory: $(System.DefaultWorkingDirectory)
|
||||
- Name: Azure/azure-sdk-tools
|
||||
Commitish: ${{ parameters.ToolsRepoCommitish }}
|
||||
WorkingDirectory: $(System.DefaultWorkingDirectory)/azure-sdk-tools
|
||||
|
||||
- template: /eng/common/pipelines/templates/steps/verify-agent-os.yml
|
||||
parameters:
|
||||
@ -133,7 +159,7 @@ jobs:
|
||||
- task: PublishPipelineArtifact@1
|
||||
inputs:
|
||||
targetPath: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results
|
||||
artifactName: results-$(MatrixName)
|
||||
artifactName: results-${{ parameters.Language }}-$(MatrixName)
|
||||
condition: always()
|
||||
|
||||
- template: /eng/common/TestResources/remove-test-resources.yml
|
||||
|
||||
@ -38,8 +38,13 @@ steps:
|
||||
} else {
|
||||
Write-Host "Repository $($repository.Name) is being initialized."
|
||||
|
||||
Write-Host "git clone --no-checkout --filter=tree:0 https://github.com/$($repository.Name) ."
|
||||
git clone --no-checkout --filter=tree:0 https://github.com/$($repository.Name) .
|
||||
if ($repository.Commitish -match '^refs/pull/\d+/merge$') {
|
||||
Write-Host "git clone --no-checkout --filter=tree:0 -c remote.origin.fetch='+$($repository.Commitish):refs/remotes/origin/$($repository.Commitish)' https://github.com/$($repository.Name) ."
|
||||
git clone --no-checkout --filter=tree:0 -c remote.origin.fetch=''+$($repository.Commitish):refs/remotes/origin/$($repository.Commitish)'' https://github.com/$($repository.Name) .
|
||||
} else {
|
||||
Write-Host "git clone --no-checkout --filter=tree:0 https://github.com/$($repository.Name) ."
|
||||
git clone --no-checkout --filter=tree:0 https://github.com/$($repository.Name) .
|
||||
}
|
||||
|
||||
Write-Host "git sparse-checkout init"
|
||||
git sparse-checkout init
|
||||
|
||||
Loading…
Reference in New Issue
Block a user