diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5e09eb0f67d..1ac44fa05ad 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,16 +14,36 @@ variables: _PublishUsingPipelines: true _DotNetArtifactsCategory: WINDOWSDESKTOP +# This is set in the pipeline directly +# When set to false, CI tests will not be enabled in builds. +# +# _ContinuousIntegrationTestsEnabled: false + +# Setting batch to true, triggers one build at a time. +# if there is a push while a build in progress, it will wait, +# until the running build finishes, and produce a build with all the changes +# # only trigger ci builds for the master and release branches trigger: -- master -- release/3.0 -- arcade - -# To be added in the future when VSTS supports this feature -# only trigger pull request builds for the master branch -# pr: -# - master + batch: true + branches: + include: + - master + - release/3.0 + # - arcade + paths: + exclude: + - Documentation/* + +pr: + autoCancel: true + branches: + include: + - master + - release/3.0 + paths: + exclude: + - Documentation/* # Call the pipeline.yml template, which does the real work jobs: diff --git a/eng/pipeline.yml b/eng/pipeline.yml index f63502e41f0..d69eed437ce 100644 --- a/eng/pipeline.yml +++ b/eng/pipeline.yml @@ -50,6 +50,8 @@ jobs: value: x86 - name: _PlatformArgs value: /p:Platform=$(_Platform) + - name: _PublicBuildPipeline # We will run Helix tests when building in the open, but do not repeat when building and publishing again using the internal build-pipeline + value: true - name: _TestHelixAgentPool value: 'Windows.10.Amd64.ClientRS5.Open' # Preferred:'Windows.10.Amd64.Open%3bWindows.7.Amd64.Open%3bWindows.10.Amd64.ClientRS5.Open'; See https://github.com/dotnet/wpf/issues/952 - name: _HelixStagingDir @@ -60,8 +62,7 @@ jobs: value: '' - name: _HelixCreator value: ${{ parameters.repoName }} - - name: _HelixPublicBuildPipeline # Run Helix tests when building in the open, do not repeat when building and publishign again using the internal build-pipeline - value: true + # Override some values if we're building internally - ${{ if eq(parameters.runAsPublic, 'false') }}: @@ -93,6 +94,8 @@ jobs: /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) - name: _OfficialBuildIdArgs value: /p:OfficialBuildId=$(BUILD.BUILDNUMBER) + - name: _PublicBuildPipeline + value: false - name: _HelixSource value: official/${{ parameters.repoName }}/$(Build.SourceBranch) - name: _HelixToken @@ -101,8 +104,7 @@ jobs: value: '' #if _HelixToken is set, Creator must be empty - name: _TestHelixAgentPool value: 'Windows.10.Amd64.ClientRS5' # Preferred: 'Windows.10.Amd64%3bWindows.7.Amd64%3bWindows.10.Amd64.ClientRS5' - - name: _HelixPublicBuildPipeline - value: false + strategy: matrix: Build_Debug_x86: @@ -140,6 +142,12 @@ jobs: $(_OfficialBuildIdArgs) $(_PlatformArgs) displayName: Windows Build / Publish + # This condition should be kept in sync with the condition for 'Run DRTs' step + # When building on a regular pipeline (!_HelixPipeline), build as usual + # When building on a Helix pipeline, only build Release configs + # (!_HelixPipeline) || + # (_HelixPipeline && _PublicBuildPipeline && _ContinuousIntegrationTestsEnabled && _BuildConfig == Release) + condition: or(ne(variables['_HelixPipeline'], 'true'), and(eq(variables['_HelixPipeline'], 'true') ,eq(variables['_BuildConfig'], 'Release'), eq(variables['_PublicBuildPipeline'], 'true'), eq(variables['_ContinuousIntegrationTestsEnabled'], 'true'))) # Run DRTs - powershell: eng\common\cibuild.cmd @@ -157,4 +165,10 @@ jobs: HelixAccessToken: $(_HelixToken) # only defined for internal CI Creator: $(_HelixCreator) SYSTEM_ACCESSTOKEN: $(System.AccessToken) - condition: and(succeeded(), eq(variables['_BuildConfig'], 'Release'), eq(variables['_HelixPublicBuildPipeline'], 'true')) # on helix machine (with real signing) when running on the public build pipeline + # This condition should be kept in sync with the condition for cibuild.cmd step with displayName: "Windows Build / Publish" + # Only run ... + # ...When building on a Helix pipeline, only build Release configs + # + # (_HelixPipeline && _PublicBuildPipeline && _ContinuousIntegrationTestsEnabled && _BuildConfig == Release) + # + condition: and(succeeded(), eq(variables['_HelixPipeline'], 'true') ,eq(variables['_BuildConfig'], 'Release'), eq(variables['_PublicBuildPipeline'], 'true'), eq(variables['_ContinuousIntegrationTestsEnabled'], 'true'))