diff --git a/eng/common/pipelines/templates/jobs/perf.yml b/eng/common/pipelines/templates/jobs/perf.yml index 3d3a3f6e31..ecd794a1f6 100644 --- a/eng/common/pipelines/templates/jobs/perf.yml +++ b/eng/common/pipelines/templates/jobs/perf.yml @@ -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 diff --git a/eng/common/pipelines/templates/steps/sparse-checkout.yml b/eng/common/pipelines/templates/steps/sparse-checkout.yml index a3b553b3a7..0a2b537be1 100644 --- a/eng/common/pipelines/templates/steps/sparse-checkout.yml +++ b/eng/common/pipelines/templates/steps/sparse-checkout.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