diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 3bfe36cca..94b673abd 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -41,17 +41,28 @@ parameters: - name: PostTestSteps type: stepList default: [] + - name: MatrixFile + type: string + default: eng/pipelines/templates/stages/platform-matrix.json + - name: JobName + type: string + default: Validate + - name: RunMetaJobs + type: boolean + default: true jobs: - template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml parameters: + GenerateJobName: ${{ parameters.JobName }}_generate_matrix MatrixConfigs: - Name: base - Path: eng/pipelines/templates/stages/platform-matrix.json + Path: ${{ parameters.MatrixFile }} Selection: all GenerateVMJobs: true JobTemplatePath: /eng/pipelines/templates/jobs/ci.tests.yml AdditionalParameters: + DisplayName: ${{ parameters.JobName }} Artifacts: ${{ parameters.Artifacts }} ServiceDirectory: ${{ parameters.ServiceDirectory }} TestPipeline: ${{ parameters.TestPipeline }} @@ -66,7 +77,7 @@ jobs: PostTestSteps: ${{ parameters.PostTestSteps }} # Disable build for cpp - client - - ${{ if ne(parameters.ServiceDirectory, 'not-specified' )}}: + - ${{ if and(eq(parameters.RunMetaJobs, 'true'), ne(parameters.ServiceDirectory, 'not-specified' )) }}: - ${{ each artifact in parameters.Artifacts }}: - job: displayName: Create API Review for ${{ artifact.name }} diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index f3e0d6812..6f88c95f5 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -52,11 +52,14 @@ parameters: - name: PostTestSteps type: stepList default: [] + - name: DisplayName + type: string + default: Validate jobs: - job: - displayName: "Validate" + displayName: ${{ parameters.DisplayName }} dependsOn: ${{ parameters.DependsOn }} condition: and(succeededOrFailed(), ne(variables['Skip.Test'], 'true'), ne(${{ parameters.Matrix }}, '{}')) strategy: diff --git a/eng/pipelines/templates/stages/archetype-cpp-release.yml b/eng/pipelines/templates/stages/archetype-cpp-release.yml index 61c13206a..acb2b1a77 100644 --- a/eng/pipelines/templates/stages/archetype-cpp-release.yml +++ b/eng/pipelines/templates/stages/archetype-cpp-release.yml @@ -5,6 +5,8 @@ parameters: TestPipeline: false DependsOn: - Build + IntegrationDependsOn: + - PrePublishBuild stages: - ${{if and(eq(variables['Build.Reason'], 'Manual'), eq(variables['System.TeamProject'], 'internal'))}}: @@ -240,8 +242,15 @@ stages: - ${{if eq(variables['System.TeamProject'], 'internal') }}: - stage: Integration - dependsOn: ${{ parameters.DependsOn }} - condition: and(succeeded(), or(eq(variables['PublishDailyVcpkg'], 'true'), eq(variables['Build.Reason'],'Schedule'))) + dependsOn: ${{ parameters.IntegrationDependsOn }} + condition: >- + and( + succeededOrFailed(), + or( + eq(variables['PublishDailyVcpkg'], 'true'), + eq(variables['Build.Reason'],'Schedule') + ) + ) jobs: - job: PublishDailyVcpkg displayName: Publish to vcpkg daily branch @@ -252,6 +261,7 @@ stages: steps: - checkout: self + - download: current artifact: packages diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index 36a1ddd4d..f6a916371 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -88,12 +88,38 @@ stages: ArtifactsSource: ${{ parameters.ArtifactsSource }} CMakeTestOptions: ${{ parameters.CMakeTestOptions }} CMakeSourceTestOptions: ${{ parameters.CMakeSourceTestOptions }} + + # PrePublishBuild runs a narrower set of fast builds. If these builds pass, + # Integration can launch immediately without awaiting more build and test jobs + - stage: PrePublishBuild + dependsOn: [] + jobs: + - template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + MatrixFile: eng/pipelines/templates/stages/platform-matrix-quick.json + JobName: QuickValidate + ServiceDirectory: ${{ parameters.ServiceDirectory }} + Artifacts: ${{ parameters.Artifacts }} + CtestRegex: ${{ parameters.CtestRegex }} + CtestExcludeRegex: ${{ parameters.CtestExcludeRegex }} + CoverageEnabled: ${{ parameters.CoverageEnabled }} + CoverageReportPath: ${{ parameters.CoverageReportPath }} + LineCoverageTarget: ${{ parameters.LineCoverageTarget }} + BranchCoverageTarget: ${{ parameters.BranchCoverageTarget }} + ${{ if eq(parameters.ServiceDirectory, 'template') }}: + TestPipeline: true + TestEnv: ${{ parameters.TestEnv }} + PreTestSteps: ${{ parameters.PreTestSteps }} + PostTestSteps: ${{ parameters.PostTestSteps }} + RunMetaJobs: false - stage: Build dependsOn: [] jobs: - template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml parameters: + MatrixFile: eng/pipelines/templates/stages/platform-matrix.json + JobName: Validate ServiceDirectory: ${{ parameters.ServiceDirectory }} Artifacts: ${{ parameters.Artifacts }} CtestRegex: ${{ parameters.CtestRegex }} @@ -128,7 +154,10 @@ stages: - template: archetype-cpp-release.yml parameters: ServiceDirectory: ${{ parameters.ServiceDirectory }} + IntegrationDependsOn: + - PrePublishBuild DependsOn: + - PrePublishBuild - Build # Only depend on `LiveTest` if there are live tests to execute - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(parameters.LiveTestCtestRegex, '')) }}: diff --git a/eng/pipelines/templates/stages/platform-matrix-quick.json b/eng/pipelines/templates/stages/platform-matrix-quick.json new file mode 100644 index 000000000..3b5e75dce --- /dev/null +++ b/eng/pipelines/templates/stages/platform-matrix-quick.json @@ -0,0 +1,22 @@ +{ + "displayNames": { + "_": "" + }, + "include": [ + { + "StaticConfigs": { + "Ubuntu22": { + "OSVmImage": "MMSUbuntu22.04", + "Pool": "azsdk-pool-mms-ubuntu-2204-general", + "VCPKG_DEFAULT_TRIPLET": "x64-linux", + "BuildArgs": "-j 10", + "RunProxyTests": true + } + }, + + "BuildSettings": { + "included": {} + } + } + ] +} diff --git a/eng/pipelines/templates/stages/platform-matrix.json b/eng/pipelines/templates/stages/platform-matrix.json index ca333afeb..e0ac5aefb 100644 --- a/eng/pipelines/templates/stages/platform-matrix.json +++ b/eng/pipelines/templates/stages/platform-matrix.json @@ -156,7 +156,6 @@ "CODE_COVERAGE": "enabled", "PublishMapFiles": "true" }, - "included": {}, "included_release": { "CMAKE_BUILD_TYPE": "Release", "CmakeArgs": " -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON -DRUN_LONG_UNIT_TESTS=ON",