pipeline.yml 7.6 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 7
parameters:

  # Needed because agent pool can't be read from a user-defined variable (Azure DevOps limitation)
8 9
  # Defaults to dotnet-internal-vs2019-preview
  agentPool: dotnet-internal-vs2019-preview
S
Steven Kirbach 已提交
10 11 12 13

  # Needed because runAsPublic is used in template expressions, which can't read from user-defined variables
  # Defaults to true
  runAsPublic: true
14
  repoName: dotnet/wpf
S
Steven Kirbach 已提交
15

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

S
Steven Kirbach 已提交
27 28
    jobs:
    - job: Windows_NT
29
      timeoutInMinutes: 120  # how long to run the job before automatically cancelling; see https://github.com/dotnet/wpf/issues/952
S
Steven Kirbach 已提交
30 31 32
      pool: ${{ parameters.agentPool }}
      variables:
        # needed for signing
S
Steven Kirbach 已提交
33
        - name: _TeamName
S
Steven Kirbach 已提交
34
          value: DotNetCore
S
Steven Kirbach 已提交
35
        - name: _SignType
36
          value: real
S
Steven Kirbach 已提交
37
        - name: _SignArgs
S
Steven Kirbach 已提交
38
          value: ''
S
Steven Kirbach 已提交
39 40

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

S
Steven Kirbach 已提交
66 67 68

        # Override some values if we're building internally
        - ${{ if eq(parameters.runAsPublic, 'false') }}:
S
Steven Kirbach 已提交
69
          # 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 已提交
70 71 72 73 74 75 76 77
          - name: _PublishType
            value: blob
          - name: _SignType
            value: real
          - name: _DotNetPublishToBlobFeed
            value: true
          - group: DotNet-Blob-Feed
          - group: DotNet-Symbol-Server-Pats
78
          - group: DotNet-HelixApi-Access
S
Steven Kirbach 已提交
79 80 81 82 83 84 85 86 87 88 89 90
          - 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)
91 92
              /p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
              /p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
S
Steven Kirbach 已提交
93 94 95 96
              /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
              /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
          - name: _OfficialBuildIdArgs
            value: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
V
Vatsan Madhavan 已提交
97 98
          - name: _PublicBuildPipeline
            value: false
99 100 101 102 103 104
          - 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 已提交
105
          - name: _TestHelixAgentPool
106
            value: 'Windows.10.Amd64.ClientRS5' # Preferred: 'Windows.10.Amd64%3bWindows.7.Amd64%3bWindows.10.Amd64.ClientRS5'
V
Vatsan Madhavan 已提交
107

S
Steven Kirbach 已提交
108 109
      strategy:
        matrix:
S
Steven Kirbach 已提交
110
          Build_Debug_x86:
S
Steven Kirbach 已提交
111 112 113 114 115
            _BuildConfig: Debug
            # override some variables for debug
            _PublishType: none
            _SignType: test
            _DotNetPublishToBlobFeed : false
S
Steven Kirbach 已提交
116
          Build_Release_x86:
S
Steven Kirbach 已提交
117
            _BuildConfig: Release
S
Steven Kirbach 已提交
118 119 120 121 122 123 124 125 126 127
          Build_Debug_x64:
            _BuildConfig: Debug
            # override some variables for debug
            _PublishType: none
            _SignType: test
            _DotNetPublishToBlobFeed : false
            _Platform: x64
          Build_Release_x64:
            _BuildConfig: Release
            _Platform: x64
S
Steven Kirbach 已提交
128 129 130
      steps:
      - checkout: self
        clean: true
131 132 133 134 135

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

S
Steven Kirbach 已提交
136 137 138 139 140 141 142
      # 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 已提交
143
          $(_PlatformArgs)
144
        displayName: Windows Build / Publish
145
        # This condition should be kept in sync with the condition for 'Run DRTs' step 
V
Vatsan Madhavan 已提交
146 147 148 149 150
        #   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')))
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167

      # 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 已提交
168 169 170 171 172 173
        # 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 已提交
174
        condition: and(succeeded(), eq(variables['_HelixPipeline'], 'true') ,eq(variables['_BuildConfig'], 'Release'), eq(variables['_PublicBuildPipeline'], 'true'), eq(variables['_ContinuousIntegrationTestsEnabled'], 'true'))