pipeline.yml 8.8 KB
Newer Older
1 2 3 4
#
# This file should be kept in sync across https://www.github.com/dotnet/wpf and dotnet-wpf-int repos. 
#
# 
S
Steven Kirbach 已提交
5

6
parameters:
S
Steven Kirbach 已提交
7 8 9
  # Needed because runAsPublic is used in template expressions, which can't read from user-defined variables
  # Defaults to true
  runAsPublic: true
10
  repoName: dotnet/wpf
S
Steven Kirbach 已提交
11

S
Steven Kirbach 已提交
12
jobs:
S
Steven Kirbach 已提交
13
- template: /eng/common/templates/jobs/jobs.yml
S
Steven Kirbach 已提交
14
  parameters:
S
Steven Kirbach 已提交
15 16
    enableMicrobuild: true
    enablePublishBuildArtifacts: true
17
    enablePublishTestResults: false # tests run in helix
S
Steven Kirbach 已提交
18
    enablePublishBuildAssets: true
C
Cesar Soares Lucas 已提交
19
    enablePublishUsingPipelines: $(_PublishUsingPipelines)
S
Steven Kirbach 已提交
20
    enableTelemetry: true
21
    helixRepo: $(repoName)
S
Steven Kirbach 已提交
22

S
Steven Kirbach 已提交
23 24
    jobs:
    - job: Windows_NT
25
      timeoutInMinutes: 120  # how long to run the job before automatically cancelling; see https://github.com/dotnet/wpf/issues/952
26
      pool:
27
        # For public jobs, use the hosted pool.  For internal jobs use the internal pool.
28
        # Will eventually change this to two BYOC pools.
29
        # agent pool can't be read from a user-defined variable (Azure DevOps limitation)
30
        ${{ if eq(variables['System.TeamProject'], 'public') }}:
31 32
          name: NetCorePublic-Pool
          queue: BuildPool.Windows.10.Amd64.VS2019.Pre.Open
33
        ${{ if eq(variables['System.TeamProject'], 'internal') }}:
34
          name: NetCoreInternal-Pool
35
          queue: buildpool.windows.10.amd64.vs2019.pre
S
Steven Kirbach 已提交
36 37
      variables:
        # needed for signing
S
Steven Kirbach 已提交
38
        - name: _TeamName
S
Steven Kirbach 已提交
39
          value: DotNetCore
S
Steven Kirbach 已提交
40
        - name: _SignType
41
          value: real
S
Steven Kirbach 已提交
42
        - name: _SignArgs
S
Steven Kirbach 已提交
43
          value: ''
S
Steven Kirbach 已提交
44 45

        # needed for darc (dependency flow) publishing
S
Steven Kirbach 已提交
46
        - name: _PublishType
S
Steven Kirbach 已提交
47
          value: none
S
Steven Kirbach 已提交
48
        - name: _DotNetPublishToBlobFeed
S
Steven Kirbach 已提交
49
          value: false
S
Steven Kirbach 已提交
50
        - name: _PublishArgs
S
Steven Kirbach 已提交
51
          value: ''
S
Steven Kirbach 已提交
52
        - name: _OfficialBuildIdArgs
S
Steven Kirbach 已提交
53
          value: ''
S
Steven Kirbach 已提交
54 55
        - name: _Platform
          value: x86
56 57
        - name: _PlatformArgs
          value: /p:Platform=$(_Platform)
V
Vatsan Madhavan 已提交
58 59
        - 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
60
        - name: _TestHelixAgentPool
61
          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
62 63 64 65 66 67 68 69
        - name: _HelixStagingDir
          value: $(BUILD.STAGINGDIRECTORY)\helix\functests
        - name: _HelixSource
          value: ${{ parameters.repoName }}/$(Build.SourceBranch)
        - name: _HelixToken
          value: ''
        - name: _HelixCreator
          value: ${{ parameters.repoName }}
70 71
        - name: _InternalRuntimeDownloadArgs
          value: ''
V
Vatsan Madhavan 已提交
72

S
Steven Kirbach 已提交
73 74 75

        # Override some values if we're building internally
        - ${{ if eq(parameters.runAsPublic, 'false') }}:
S
Steven Kirbach 已提交
76
          # note: You have to use list syntax here (- name: value) or you will get errors about declaring the same variable multiple times
S
Steven Kirbach 已提交
77 78 79 80 81 82 83 84
          - name: _PublishType
            value: blob
          - name: _SignType
            value: real
          - name: _DotNetPublishToBlobFeed
            value: true
          - group: DotNet-Blob-Feed
          - group: DotNet-Symbol-Server-Pats
85
          - group: DotNet-HelixApi-Access
S
Steven Kirbach 已提交
86 87 88 89 90 91 92 93 94 95 96 97
          - name: _PublishBlobFeedUrl
            value: https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json

          # note: Even though they are referenced here, user defined variables (like $(_SignType)) are not resolved 
          # until the agent is running on the machine. They can be overridden any time before they are resolved,
          # like in the job matrix below (see Build_Debug)
          - name: _SignArgs
            value: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName)
          - name: _PublishArgs
            value: /p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
              /p:DotNetPublishBlobFeedUrl=$(_PublishBlobFeedUrl)
              /p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
98 99
              /p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
              /p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
S
Steven Kirbach 已提交
100 101 102 103
              /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
              /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
          - name: _OfficialBuildIdArgs
            value: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
V
Vatsan Madhavan 已提交
104 105
          - name: _PublicBuildPipeline
            value: false
106 107 108 109 110 111
          - name: _HelixSource
            value: official/${{ parameters.repoName }}/$(Build.SourceBranch)
          - name: _HelixToken
            value: '$(HelixApiAccessToken)' # from DotNet-HelixApi-Access group
          - name: _HelixCreator
            value: '' #if _HelixToken is set, Creator must be empty
S
Steven Kirbach 已提交
112
          - name: _TestHelixAgentPool
113
            value: 'Windows.10.Amd64.ClientRS5' # Preferred: 'Windows.10.Amd64%3bWindows.7.Amd64%3bWindows.10.Amd64.ClientRS5'
114 115 116 117
          - group: DotNet-MSRC-Storage
          - name: _InternalRuntimeDownloadArgs
            value: /p:DotNetRuntimeSourceFeed=https://dotnetclimsrc.blob.core.windows.net/dotnet
              /p:DotNetRuntimeSourceFeedKey=$(dotnetclimsrc-read-sas-token-base64)
V
Vatsan Madhavan 已提交
118

S
Steven Kirbach 已提交
119 120
      strategy:
        matrix:
121 122 123 124 125
          ${{ if eq(parameters.runAsPublic, 'true') }}:
            Build_Debug_x86:
              _BuildConfig: Debug
              # override some variables for debug
              # _SignType has to be real for package publishing to succeed - do not override to test.
S
Steven Kirbach 已提交
126
          Build_Release_x86:
S
Steven Kirbach 已提交
127
            _BuildConfig: Release
128 129 130 131 132 133
          ${{ if eq(parameters.runAsPublic, 'true') }}:
            Build_Debug_x64:
              _BuildConfig: Debug
              # override some variables for debug
              # _SignType has to be real for package publishing to succeed - do not override to test.
              _Platform: x64
S
Steven Kirbach 已提交
134 135 136
          Build_Release_x64:
            _BuildConfig: Release
            _Platform: x64
S
Steven Kirbach 已提交
137 138 139
      steps:
      - checkout: self
        clean: true
140 141 142 143 144

      # Set VSO Variable(s)
      - powershell: eng\pre-build.ps1
        displayName: Pre-Build - Set VSO Variables

145 146 147 148 149 150 151 152 153
      - ${{ if ne(variables['System.TeamProject'], 'public') }}:
        - task: PowerShell@2
          displayName: Setup Private Feeds Credentials
          inputs:
            filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
            arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
          env:
            Token: $(dn-bot-dnceng-artifact-feeds-rw)

S
Steven Kirbach 已提交
154 155 156 157 158 159 160
      # Use utility script to run script command dependent on agent OS.
      - script: eng\common\cibuild.cmd
          -configuration $(_BuildConfig) 
          -prepareMachine
          $(_PublishArgs)
          $(_SignArgs)
          $(_OfficialBuildIdArgs)
S
Steven Kirbach 已提交
161
          $(_PlatformArgs)
162
          $(_InternalRuntimeDownloadArgs)
163
        displayName: Windows Build / Publish
164
        # This condition should be kept in sync with the condition for 'Run DRTs' step 
V
Vatsan Madhavan 已提交
165 166 167 168 169
        #   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')))
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186

      # Run DRTs
      - powershell: eng\common\cibuild.cmd
          -configuration $(_BuildConfig)
          $(_OfficialBuildIdArgs) 
          $(_PlatformArgs)
          -projects $(Build.SourcesDirectory)\eng\helixpublish.proj
          /bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\HelixDrt.binlog
        displayName: Run Developer Regression Tests on Helix Machine (Release)
        env:
          HelixSource: $(_HelixSource)
          HelixType: 'tests/drt'
          HelixBuild: $(Build.BuildNumber)
          HelixTargetQueues: $(_TestHelixAgentPool)
          HelixAccessToken: $(_HelixToken)              # only defined for internal CI
          Creator: $(_HelixCreator)
          SYSTEM_ACCESSTOKEN: $(System.AccessToken)
V
Vatsan Madhavan 已提交
187 188 189 190 191 192
        # 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)
        #
V
Vatsan Madhavan 已提交
193
        condition: and(succeeded(), eq(variables['_HelixPipeline'], 'true') ,eq(variables['_BuildConfig'], 'Release'), eq(variables['_PublicBuildPipeline'], 'true'), eq(variables['_ContinuousIntegrationTestsEnabled'], 'true'))
194