From fa12efa008a18510f55d7dd81230f74dcb08e588 Mon Sep 17 00:00:00 2001 From: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Date: Tue, 11 Jul 2023 16:08:38 -0400 Subject: [PATCH] Use sparse checkout in Compliance job (#35821) Use sparse checkout in Compliance job --- eng/pipelines/templates/jobs/ci.yml | 44 ++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/templates/jobs/ci.yml b/eng/pipelines/templates/jobs/ci.yml index d40e9a2cb3d61..0c8d7df48951d 100644 --- a/eng/pipelines/templates/jobs/ci.yml +++ b/eng/pipelines/templates/jobs/ci.yml @@ -67,7 +67,7 @@ jobs: steps: # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories - # as we require the github service connection to be loaded. + # as we require the GitHub service connection to be loaded. - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml parameters: @@ -100,7 +100,7 @@ jobs: -ProjectList $(ProjectList) # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories - # as we require the github service connection to be loaded. + # as we require the GitHub service connection to be loaded. - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml parameters: @@ -234,7 +234,7 @@ jobs: versionSpec: $(PythonVersion) # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories - # as we require the github service connection to be loaded. + # as we require the GitHub service connection to be loaded. - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml parameters: @@ -269,7 +269,7 @@ jobs: -ProjectList $(ProjectList) # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories - # as we require the github service connection to be loaded. + # as we require the GitHub service connection to be loaded. - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml parameters: @@ -410,7 +410,43 @@ jobs: pool: name: azsdk-pool-mms-win-2022-general vmImage: windows-2022 + steps: + # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories + # as we require the GitHub service connection to be loaded. + - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: + - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml + parameters: + Paths: + - '**/*.xml' + - '**/*.md' + - '!sdk/**/test-recordings' + - '!sdk/**/session-records' + + - template: /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml + parameters: + Artifacts: ${{ parameters.Artifacts }} + AdditionalModules: ${{ parameters.AdditionalModules }} + JobType: 'Compliance' + UseCache: false + + - task: PowerShell@2 + displayName: Generate directories variable for sparse checkout + inputs: + pwsh: true + filePath: $(Build.SourcesDirectory)/eng/scripts/Generate-ServiceDirectories-From-Project-List.ps1 + arguments: > + -SourcesDirectory $(Build.SourcesDirectory) + -ProjectList $(ProjectList) + + # Skip sparse checkout for the `azure-sdk-for--pr` private mirrored repositories + # as we require the GitHub service connection to be loaded. + - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: + - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml + parameters: + Paths: $(SparseCheckoutDirectories) + SkipCheckoutNone: true + - template: /eng/common/pipelines/templates/steps/credscan.yml parameters: ServiceDirectory: ${{ parameters.ServiceDirectory }}