Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync eng/common directory with azure-sdk-tools for PR 3874 #1181

Merged
merged 17 commits into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 50 additions & 24 deletions eng/common/pipelines/templates/jobs/perf.yml
Original file line number Diff line number Diff line change
@@ -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: []
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions eng/common/pipelines/templates/steps/sparse-checkout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down