summaryrefslogtreecommitdiff
path: root/eng/xplat-job.yml
blob: 6beda4ea5591ae534600019142ec1beed7ec62a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
parameters:
  buildConfig: ''
  archType: ''
  osGroup: ''
  osIdentifier: ''
  name: ''
  helixType: '(unspecified)'
  container: ''
  crossrootfsDir: ''

  # arcade-specific parameters
  condition: ''
  continueOnError: false
  dependsOn: ''
  displayName: ''
  timeoutInMinutes: ''
  enableMicrobuild: ''
  gatherAssetManifests: false

  variables: {} ## any extra variables to add to the defaults defined below

jobs:
- template: /eng/common/templates/job/job.yml
  parameters:

    name: ${{ parameters.name }}
    displayName: ${{ parameters.displayName }}

    condition: ${{ parameters.condition }}
    dependsOn: ${{ parameters.dependsOn }}
    timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
    continueOnError: ${{ parameters.continueOnError }}

    # Send telemetry for all builds
    enableTelemetry: true
    helixRepo: 'dotnet/coreclr'
    helixType: ${{ parameters.helixType }}

    enableMicrobuild: ${{ parameters.enableMicrobuild }}
    enablePublishUsingPipelines: true

    pool:

      # Public Linux Build Pool
      ${{ if and(eq(parameters.osGroup, 'Linux'), eq(variables['System.TeamProject'], 'public')) }}:
        name:  NetCorePublic-Pool
        queue: BuildPool.Ubuntu.1604.Amd64.Open

      # Official Build Linux Pool
      ${{ if and(eq(parameters.osGroup, 'Linux'), ne(variables['System.TeamProject'], 'public')) }}:
        name: NetCoreInternal-Pool
        queue: BuildPool.Ubuntu.1604.Amd64

      # FreeBSD builds only in the internal project
      ${{ if and(eq(parameters.osGroup, 'FreeBSD'), ne(variables['System.TeamProject'], 'public')) }}:
        name: dnceng-freebsd-internal

      # Public OSX Build Pool
      ${{ if and(eq(parameters.osGroup, 'OSX'), ne(variables['System.TeamProject'], 'public')) }}:
        name: Hosted Mac Internal

      # Official Build OSX Pool
      ${{ if and(eq(parameters.osGroup, 'OSX'), eq(variables['System.TeamProject'], 'public')) }}:
        name: Hosted MacOS

      # Official Build Windows Pool
      ${{ if and(eq(parameters.osGroup, 'Windows_NT'), ne(variables['System.TeamProject'], 'public')) }}:
        name: NetCoreInternal-Pool
        queue: BuildPool.Windows.10.Amd64.VS2017

      # Public Windows Build Pool
      ${{ if and(eq(parameters.osGroup, 'Windows_NT'), eq(variables['System.TeamProject'], 'public')) }}:
        name: NetCorePublic-Pool
        queue: BuildPool.Windows.10.Amd64.VS2017.Open

    workspace:
      clean: all

    ${{ if ne(parameters.container, '') }}:
      ${{ if eq(parameters.container.registry, 'mcr') }}:
        container: ${{ format('{0}:{1}', 'mcr.microsoft.com/dotnet-buildtools/prereqs', parameters.container.image) }}
      ${{ if ne(parameters.container.registry, 'mcr') }}:
        container: ${{ format('{0}:{1}', parameters.container.registry, parameters.container.image) }}

    ${{ if eq(parameters.osGroup, 'Linux') }}:
      agentOs: Ubuntu
    ${{ if eq(parameters.osGroup, 'FreeBSD') }}:
      agentOs: FreeBSD
    ${{ if eq(parameters.osGroup, 'OSX') }}:
      agentOs: MacOS
    ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
      agentOs: Windows_NT

    # Setting this results in the arcade job template including a step
    # that gathers asset manifests and publishes them to pipeline
    # storage. Only relevant for build jobs.
    enablePublishBuildAssets: ${{ parameters.gatherAssetManifests }}

    variables:
    - name: buildConfig
      value: ${{ parameters.buildConfig }}
        
    - ${{ if eq(parameters.buildConfig, 'checked') }}:
      - name: buildConfigUpper
        value: 'Checked'

    - ${{ if eq(parameters.buildConfig, 'debug') }}:
      - name: buildConfigUpper
        value: 'Debug'

    - ${{ if eq(parameters.buildConfig, 'release') }}:
      - name: buildConfigUpper
        value: 'Release'

    - name: _BuildConfig
      value: $(buildConfigUpper)

    - name: archType
      value: ${{ parameters.archType }}

    - name: osGroup
      value: ${{ parameters.osGroup }}

    - name: osIdentifier
      value: ${{ parameters.osIdentifier }}
      
    - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
      - name: _HelixSource
        value: official/dotnet/coreclr/$(Build.SourceBranch)
    - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}:
      - name: _HelixSource
        value: pr/dotnet/coreclr/$(Build.SourceBranch)
    - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}:
      - name: _HelixSource
        value: ci/dotnet/coreclr/$(Build.SourceBranch)

    - ${{ if ne(parameters.crossrootfsDir, '') }}:
      - name: crossArg
        value: 'cross'
      - name: crossPackagesArg
        value: '-__DoCrossArchBuild=1'
      # This is only required for cross builds.
      - name: ROOTFS_DIR
        value: ${{ parameters.crossrootfsDir }}
    - ${{ if eq(parameters.crossrootfsDir, '') }}:
      - name: crossArg
        value: ''
      - name: crossPackagesArg
        value: ''

    - ${{ each variable in parameters.variables }}:
      - ${{insert}}: ${{ variable }}

    steps: ${{ parameters.steps }}