|
1 | | -# This is a simple wrapper for eng/pipeline.yml to get around the limitation of |
2 | | -# user-defined variables not being available in yaml template expressions. |
3 | | - |
4 | | -# Parameters ARE available in template expressions, and parameters can have default values, |
5 | | -# so they can be used to control yaml flow. |
6 | | -# |
7 | | - |
8 | | -variables: |
9 | | - # clean the local repo on the build agents |
10 | | - - name: Build.Repository.Clean |
11 | | - value: true |
12 | | - - name: _DotNetArtifactsCategory |
13 | | - value: WINDOWSDESKTOP |
14 | | - - name: _DotNetValidationArtifactsCategory |
15 | | - value: WINDOWSDESKTOP |
16 | | - - ${{ if or(startswith(variables['Build.SourceBranch'], 'refs/heads/release/'), startswith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), eq(variables['Build.Reason'], 'Manual')) }}: |
17 | | - - name: PostBuildSign |
18 | | - value: false |
19 | | - - ${{ else }}: |
20 | | - - name: PostBuildSign |
21 | | - value: true |
22 | | - |
23 | | - - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: |
24 | | - - group: DotNet-Wpf-SDLValidation-Params |
25 | | - |
26 | | - |
27 | | -# This is set in the pipeline directly |
28 | | -# When set to false, CI tests will not be enabled in builds. |
29 | | -# |
30 | | -# _ContinuousIntegrationTestsEnabled: false |
31 | | - |
32 | | -# Setting batch to true, triggers one build at a time. |
33 | | -# if there is a push while a build in progress, it will wait, |
34 | | -# until the running build finishes, and produce a build with all the changes |
35 | | -# |
36 | | -# only trigger ci builds for the master and release branches |
37 | 1 | trigger: |
38 | 2 | batch: true |
39 | 3 | branches: |
|
59 | 23 | exclude: |
60 | 24 | - Documentation/* |
61 | 25 |
|
62 | | -# Call the pipeline-pr.yml template, which does the real work |
| 26 | +variables: |
| 27 | +- name: repoName |
| 28 | + value: dotnet/wpf |
| 29 | + |
63 | 30 | stages: |
64 | 31 | - stage: build |
65 | 32 | displayName: Build |
66 | 33 | jobs: |
67 | | - - template: /eng/pipeline-pr.yml |
| 34 | + - template: /eng/common/templates/jobs/jobs.yml@self |
68 | 35 | parameters: |
69 | | - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: |
70 | | - runAsPublic: false |
| 36 | + enablePublishBuildArtifacts: true |
| 37 | + enablePublishTestResults: false |
| 38 | + enablePublishBuildAssets: false |
| 39 | + enablePublishUsingPipelines: false |
| 40 | + enableTelemetry: true |
| 41 | + helixRepo: $(repoName) |
71 | 42 |
|
72 | | -- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: |
73 | | - - template: eng\common\templates\post-build\post-build.yml |
74 | | - parameters: |
75 | | - publishingInfraVersion: 3 |
76 | | - enableSymbolValidation: false |
77 | | - enableSigningValidation: false |
78 | | - enableNugetValidation: false |
79 | | - enableSourceLinkValidation: false |
80 | | - # This is to enable SDL runs part of Post-Build Validation Stage |
81 | | - SDLValidationParameters: |
82 | | - enable: false |
83 | | - params: ' -SourceToolsList @("policheck","credscan") |
84 | | - -TsaInstanceURL $(_TsaInstanceURL) |
85 | | - -TsaProjectName $(_TsaProjectName) |
86 | | - -TsaNotificationEmail $(_TsaNotificationEmail) |
87 | | - -TsaCodebaseAdmin $(_TsaCodebaseAdmin) |
88 | | - -TsaBugAreaPath $(_TsaBugAreaPath) |
89 | | - -TsaIterationPath $(_TsaIterationPath) |
90 | | - -TsaRepositoryName "wpf" |
91 | | - -TsaCodebaseName "wpf" |
92 | | - -TsaPublish $True' |
| 43 | + jobs: |
| 44 | + - job: Windows_NT |
| 45 | + timeoutInMinutes: 120 # how long to run the job before automatically cancelling; see https://github.com/dotnet/wpf/issues/952 |
| 46 | + pool: |
| 47 | + # For public jobs, use the hosted pool. For internal jobs use the internal pool. |
| 48 | + # Will eventually change this to two BYOC pools. |
| 49 | + # agent pool can't be read from a user-defined variable (Azure DevOps limitation) |
| 50 | + ${{ if eq(variables['System.TeamProject'], 'public') }}: |
| 51 | + name: NetCore-Public |
| 52 | + demands: ImageOverride -equals windows.vs2022.amd64.Open |
| 53 | + ${{ if eq(variables['System.TeamProject'], 'internal') }}: |
| 54 | + name: NetCore1ESPool-Internal |
| 55 | + demands: ImageOverride -equals windows.vs2022.amd64 |
| 56 | + variables: |
| 57 | + - name: _Platform |
| 58 | + value: x86 |
| 59 | + - name: _PlatformArgs |
| 60 | + value: /p:Platform=$(_Platform) |
| 61 | + - name: _TestHelixAgentPool |
| 62 | + 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 |
| 63 | + - name: _HelixStagingDir |
| 64 | + value: $(BUILD.STAGINGDIRECTORY)\helix\functests |
| 65 | + - name: _HelixSource |
| 66 | + value: $(repoName)/$(Build.SourceBranch) |
| 67 | + - name: _HelixToken |
| 68 | + value: '' |
| 69 | + - name: _HelixCreator |
| 70 | + value: $(repoName) |
| 71 | + - name: _programfilesx86 |
| 72 | + value: ${Env:ProgramFiles(x86)}/dotnet |
| 73 | + - name: _programfiles |
| 74 | + value: ${Env:ProgramFiles}/dotnet |
| 75 | + - ${{ if ne(variables['System.TeamProject'], 'internal') }}: |
| 76 | + - name: _InternalRuntimeDownloadArgs |
| 77 | + value: '' |
| 78 | + - ${{ if eq(variables['System.TeamProject'], 'internal') }}: |
| 79 | + - group: AzureDevOps-Artifact-Feeds-Pats |
| 80 | + - group: DotNet-HelixApi-Access |
| 81 | + - name: _InternalRuntimeDownloadArgs |
| 82 | + value: >- |
| 83 | + /p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal |
| 84 | + /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) |
| 85 | + - name: _HelixSource |
| 86 | + value: official/$(repoName)/$(Build.SourceBranch) |
| 87 | + - name: _HelixToken |
| 88 | + value: '$(HelixApiAccessToken)' # from DotNet-HelixApi-Access group |
| 89 | + - name: _HelixCreator |
| 90 | + value: '' #if _HelixToken is set, Creator must be empty |
| 91 | + - name: _TestHelixAgentPool |
| 92 | + value: 'Windows.10.Amd64.ClientRS5' # Preferred: 'Windows.10.Amd64%3bWindows.7.Amd64%3bWindows.10.Amd64.ClientRS5' |
| 93 | + |
| 94 | + strategy: |
| 95 | + matrix: |
| 96 | + Build_Debug_x86: |
| 97 | + _BuildConfig: Debug |
| 98 | + Build_Release_x86: |
| 99 | + _BuildConfig: Release |
| 100 | + Build_Debug_x64: |
| 101 | + _BuildConfig: Debug |
| 102 | + _Coverage: true |
| 103 | + # override some variables for debug |
| 104 | + # _SignType has to be real for package publishing to succeed - do not override to test. |
| 105 | + _Platform: x64 |
| 106 | + Build_Release_x64: |
| 107 | + _BuildConfig: Release |
| 108 | + _Platform: x64 |
| 109 | + Build_Debug_arm64: |
| 110 | + _BuildConfig: Debug |
| 111 | + # override some variables for debug |
| 112 | + # _SignType has to be real for package publishing to succeed - do not override to test. |
| 113 | + _Platform: arm64 |
| 114 | + Build_Release_arm64: |
| 115 | + _BuildConfig: Release |
| 116 | + _Platform: arm64 |
| 117 | + steps: |
| 118 | + # Set VSO Variable(s) |
| 119 | + - powershell: eng\pre-build.ps1 |
| 120 | + displayName: Pre-Build - Set VSO Variables |
| 121 | + |
| 122 | + - template: /eng/common/templates/steps/enable-internal-sources.yml |
| 123 | + - template: /eng/common/templates/steps/enable-internal-runtimes.yml |
| 124 | + |
| 125 | + # Use utility script to run script command dependent on agent OS. |
| 126 | + - script: eng\scripts\cibuild.cmd |
| 127 | + -configuration $(_BuildConfig) |
| 128 | + -prepareMachine |
| 129 | + $(_PlatformArgs) |
| 130 | + $(_InternalRuntimeDownloadArgs) |
| 131 | + /p:Coverage=$(_Coverage) |
| 132 | + displayName: Windows Build / Publish |
| 133 | + |
| 134 | + - script: eng\scripts\ciunittest.cmd |
| 135 | + -configuration $(_BuildConfig) |
| 136 | + -prepareMachine |
| 137 | + $(_PlatformArgs) |
| 138 | + $(_InternalRuntimeDownloadArgs) |
| 139 | + /bl:$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\Test.binlog |
| 140 | + /p:Coverage=$(_Coverage) |
| 141 | + displayName: Run xUnit Tests |
| 142 | + condition: eq(variables['_Platform'], 'x64') |
| 143 | + |
| 144 | + - task: PublishTestResults@2 |
| 145 | + displayName: Publish XUnit Test Results |
| 146 | + inputs: |
| 147 | + testRunner: VSTest |
| 148 | + testResultsFiles: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/*.trx' |
| 149 | + mergeTestResults: true |
| 150 | + condition: and(succeededOrFailed(), eq(variables['_BuildConfig'], 'Debug'), eq(variables['_Platform'], 'x64')) |
| 151 | + |
| 152 | + # Upload code coverage data |
| 153 | + - script: dotnet msbuild -binaryLogger:artifacts\log\$(_BuildConfig)\uploadCodeCov.binlog;ProjectImports=Embed -restore eng/CodeCoverage.proj |
| 154 | + displayName: Upload coverage to codecov.io |
| 155 | + condition: and(succeeded(), eq(variables['_Coverage'], True), eq(variables['_BuildConfig'], 'Debug'), eq(variables['_Platform'], 'x64')) |
0 commit comments