|
| 1 | +parameters: |
| 2 | +- name: isBuiltFromVmr |
| 3 | + type: boolean |
| 4 | + default: false |
| 5 | + |
| 6 | +- name: pool_Linux |
| 7 | + type: object |
| 8 | + |
| 9 | +- name: pool_LinuxArm64 |
| 10 | + type: object |
| 11 | + |
| 12 | +# Scope of jobs which are executed |
| 13 | +- name: scope |
| 14 | + type: string |
| 15 | + |
| 16 | +- name: useMicrosoftBuildAssetsForTests |
| 17 | + type: boolean |
| 18 | + |
| 19 | +- name: legs |
| 20 | + type: object |
| 21 | + |
| 22 | +stages: |
| 23 | +- stage: VMR_SourceOnly_Build |
| 24 | + displayName: VMR Source-Only Build |
| 25 | + dependsOn: [] |
| 26 | + variables: |
| 27 | + - template: ../variables/vmr-build.yml |
| 28 | + parameters: |
| 29 | + vmrBranch: ${{ variables.VmrBranch }} |
| 30 | + buildSourceOnly: true |
| 31 | + jobs: |
| 32 | + - ${{ each leg in parameters.legs }}: |
| 33 | + - template: ../jobs/vmr-build.yml |
| 34 | + parameters: |
| 35 | + # CentOS |
| 36 | + ${{ if eq(leg.distro, 'centos') }}: |
| 37 | + buildName: ${{ format(leg.buildNameFormat, variables.centOSStreamName) }} |
| 38 | + container: |
| 39 | + name: ${{ variables.centOSStreamContainerName }} |
| 40 | + image: ${{ variables.centOSStreamContainerImage }} |
| 41 | + ${{ if ne(leg.reuseBuildArtifactsFrom, '') }}: |
| 42 | + reuseBuildArtifactsFrom: |
| 43 | + - ${{ format(leg.reuseBuildArtifactsFrom, variables.centOSStreamName) }} |
| 44 | + ${{ if and(contains(leg.buildNameFormat, 'Previous'), eq(leg.targetArchitecture, 'x64')) }}: |
| 45 | + artifactsRid: ${{ variables.centOSStreamX64Rid }} |
| 46 | + # Fedora |
| 47 | + ${{ elseif eq(leg.distro, 'fedora') }}: |
| 48 | + buildName: ${{ format(leg.buildNameFormat, variables.fedoraName) }} |
| 49 | + container: |
| 50 | + name: ${{ variables.fedoraContainerName }} |
| 51 | + image: ${{ variables.fedoraContainerImage }} |
| 52 | + ${{ if ne(leg.reuseBuildArtifactsFrom, '') }}: |
| 53 | + reuseBuildArtifactsFrom: |
| 54 | + - ${{ format(leg.reuseBuildArtifactsFrom, variables.fedoraName) }} |
| 55 | + # Ubuntu |
| 56 | + ${{ elseif eq(leg.distro, 'ubuntu') }}: |
| 57 | + buildName: ${{ format(leg.buildNameFormat, variables.ubuntuName) }} |
| 58 | + ${{ if eq(leg.targetArchitecture, 'arm64') }}: |
| 59 | + container: |
| 60 | + name: ${{ variables.ubuntuArmContainerName }} |
| 61 | + image: ${{ variables.ubuntuArmContainerImage }} |
| 62 | + ${{ else }}: |
| 63 | + container: |
| 64 | + name: ${{ variables.ubuntuContainerName }} |
| 65 | + image: ${{ variables.ubuntuContainerImage }} |
| 66 | + ${{ if ne(leg.reuseBuildArtifactsFrom, '') }}: |
| 67 | + reuseBuildArtifactsFrom: |
| 68 | + - ${{ format(leg.reuseBuildArtifactsFrom, variables.centOSStreamName) }} |
| 69 | + # AlmaLinux |
| 70 | + ${{ elseif eq(leg.distro, 'almalinux') }}: |
| 71 | + buildName: ${{ format(leg.buildNameFormat, variables.almaLinuxName) }} |
| 72 | + container: |
| 73 | + name: ${{ variables.almaLinuxContainerName }} |
| 74 | + image: ${{ variables.almaLinuxContainerImage }} |
| 75 | + ${{ if ne(leg.reuseBuildArtifactsFrom, '') }}: |
| 76 | + reuseBuildArtifactsFrom: |
| 77 | + - ${{ format(leg.reuseBuildArtifactsFrom, variables.centOSStreamName) }} |
| 78 | + targetRid: ${{ variables.almaLinuxX64Rid }} |
| 79 | + # Alpine |
| 80 | + ${{ elseif eq(leg.distro, 'alpine') }}: |
| 81 | + buildName: ${{ format(leg.buildNameFormat, variables.alpineName) }} |
| 82 | + container: |
| 83 | + name: ${{ variables.alpineContainerName }} |
| 84 | + image: ${{ variables.alpineContainerImage }} |
| 85 | + ${{ if ne(leg.reuseBuildArtifactsFrom, '') }}: |
| 86 | + reuseBuildArtifactsFrom: |
| 87 | + - ${{ format(leg.reuseBuildArtifactsFrom, variables.centOSStreamName) }} |
| 88 | + targetRid: ${{ variables.alpineX64Rid }} |
| 89 | + |
| 90 | + isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }} |
| 91 | + vmrBranch: ${{ variables.VmrBranch }} |
| 92 | + targetArchitecture: ${{ leg.targetArchitecture }} |
| 93 | + ${{ if eq(leg.targetArchitecture, 'arm64') }}: |
| 94 | + pool: ${{ parameters.pool_LinuxArm64 }} |
| 95 | + ${{ else }}: |
| 96 | + pool: ${{ parameters.pool_Linux }} |
| 97 | + buildSourceOnly: true |
| 98 | + ${{ if eq(parameters.useMicrosoftBuildAssetsForTests, false) }}: |
| 99 | + runTests: false |
| 100 | + extraProperties: "/p:DisableDevBuildAsDefaultForSourceOnly=true" |
| 101 | + buildFromArchive: ${{ leg.buildFromArchive }} |
| 102 | + runOnline: ${{ leg.runOnline }} |
| 103 | + useMonoRuntime: ${{ leg.useMonoRuntime }} |
| 104 | + withPreviousSDK: ${{ leg.withPreviousSDK }} |
| 105 | + |
| 106 | +- ${{ if eq(parameters.useMicrosoftBuildAssetsForTests, true) }}: |
| 107 | + - stage: VMR_SourceOnly_Validation |
| 108 | + displayName: VMR Source-Only Validation |
| 109 | + dependsOn: |
| 110 | + - VMR_Vertical_Build |
| 111 | + - VMR_SourceOnly_Build |
| 112 | + variables: |
| 113 | + - template: ../variables/vmr-build.yml |
| 114 | + parameters: |
| 115 | + vmrBranch: ${{ variables.VmrBranch }} |
| 116 | + buildSourceOnly: true |
| 117 | + jobs: |
| 118 | + - ${{ each leg in parameters.legs }}: |
| 119 | + - template: ../jobs/vmr-build.yml |
| 120 | + parameters: |
| 121 | + # CentOS |
| 122 | + ${{ if eq(leg.distro, 'centos') }}: |
| 123 | + buildName: ${{ format(leg.buildNameFormat, variables.centOSStreamName) }}_Validation |
| 124 | + container: |
| 125 | + name: ${{ variables.centOSStreamContainerName }} |
| 126 | + image: ${{ variables.centOSStreamContainerImage }} |
| 127 | + # Fedora |
| 128 | + ${{ elseif eq(leg.distro, 'fedora') }}: |
| 129 | + buildName: ${{ format(leg.buildNameFormat, variables.fedoraName) }}_Validation |
| 130 | + container: |
| 131 | + name: ${{ variables.fedoraContainerName }} |
| 132 | + image: ${{ variables.fedoraContainerImage }} |
| 133 | + # Ubuntu |
| 134 | + ${{ elseif eq(leg.distro, 'ubuntu') }}: |
| 135 | + buildName: ${{ format(leg.buildNameFormat, variables.ubuntuName) }}_Validation |
| 136 | + ${{ if eq(leg.targetArchitecture, 'arm64') }}: |
| 137 | + container: |
| 138 | + name: ${{ variables.ubuntuArmContainerName }} |
| 139 | + image: ${{ variables.ubuntuArmContainerImage }} |
| 140 | + ${{ else }}: |
| 141 | + container: |
| 142 | + name: ${{ variables.ubuntuContainerName }} |
| 143 | + image: ${{ variables.ubuntuContainerImage }} |
| 144 | + # AlmaLinux |
| 145 | + ${{ elseif eq(leg.distro, 'almalinux') }}: |
| 146 | + buildName: ${{ format(leg.buildNameFormat, variables.almaLinuxName) }}_Validation |
| 147 | + container: |
| 148 | + name: ${{ variables.almaLinuxContainerName }} |
| 149 | + image: ${{ variables.almaLinuxContainerImage }} |
| 150 | + targetRid: ${{ variables.almaLinuxX64Rid }} |
| 151 | + # Alpine |
| 152 | + ${{ elseif eq(leg.distro, 'alpine') }}: |
| 153 | + buildName: ${{ format(leg.buildNameFormat, variables.alpineName) }}_Validation |
| 154 | + container: |
| 155 | + name: ${{ variables.alpineContainerName }} |
| 156 | + image: ${{ variables.alpineContainerImage }} |
| 157 | + targetRid: ${{ variables.alpineX64Rid }} |
| 158 | + |
| 159 | + isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }} |
| 160 | + vmrBranch: ${{ variables.VmrBranch }} |
| 161 | + targetArchitecture: ${{ leg.targetArchitecture }} |
| 162 | + ${{ if eq(leg.targetArchitecture, 'arm64') }}: |
| 163 | + pool: ${{ parameters.pool_LinuxArm64 }} |
| 164 | + ${{ else }}: |
| 165 | + pool: ${{ parameters.pool_Linux }} |
| 166 | + buildSourceOnly: true |
| 167 | + runOnline: ${{ leg.runOnline }} |
| 168 | + runTests: true |
| 169 | + enablePoison: ${{ leg.enablePoison }} |
| 170 | + skipBuild: true |
| 171 | + extraProperties: > |
| 172 | + /p:DotNetSourceOnlyTestOnly=true |
| 173 | + /p:ExtraRestoreSourcePath=$(Pipeline.Workspace)/msft-pkgs |
| 174 | + /p:RestoreAdditionalProjectSources=$(Pipeline.Workspace)/msft-pkgs |
| 175 | + |
| 176 | + testInitSteps: |
| 177 | + # Ensure the artifacts staging directory exists so that even if no files get placed there, it won't fail |
| 178 | + # when publishing the artifacts. |
| 179 | + - script: mkdir -p $(artifactsStagingDir) |
| 180 | + displayName: Create Artifacts Staging Directory |
| 181 | + - ${{ if eq(leg.distro, 'alpine') }}: |
| 182 | + - template: ../steps/download-artifacts.yml |
| 183 | + parameters: |
| 184 | + artifactDescription: Microsoft Linux (musl) Packages |
| 185 | + artifactName: AzureLinux_x64_Cross_Alpine_${{ leg.targetArchitecture }}_Artifacts |
| 186 | + downloadFilePatterns: packages/Release/Shipping/** |
| 187 | + copyDestination: $(Pipeline.Workspace)/msft-pkgs |
| 188 | + flattenDirs: true |
| 189 | + - ${{ else }}: |
| 190 | + - template: ../steps/download-artifacts.yml |
| 191 | + parameters: |
| 192 | + artifactDescription: Microsoft Linux Packages |
| 193 | + artifactName: AzureLinux_x64_Cross_${{ leg.targetArchitecture }}_Artifacts |
| 194 | + downloadFilePatterns: packages/Release/Shipping/** |
| 195 | + copyDestination: $(Pipeline.Workspace)/msft-pkgs |
| 196 | + flattenDirs: true |
| 197 | + - template: ../steps/download-artifacts.yml |
| 198 | + parameters: |
| 199 | + artifactDescription: Microsoft WASM Packages |
| 200 | + artifactName: Browser_Shortstack_wasm_Artifacts |
| 201 | + downloadFilePatterns: packages/Release/Shipping/** |
| 202 | + copyDestination: $(Pipeline.Workspace)/msft-pkgs |
| 203 | + flattenDirs: true |
| 204 | + - template: ../steps/download-artifacts.yml |
| 205 | + parameters: |
| 206 | + artifactDescription: Microsoft Windows Packages |
| 207 | + artifactName: Windows_x64_Artifacts |
| 208 | + downloadFilePatterns: packages/Release/Shipping/** |
| 209 | + copyDestination: $(Pipeline.Workspace)/msft-pkgs |
| 210 | + flattenDirs: true |
| 211 | + - template: ../steps/download-artifacts.yml |
| 212 | + parameters: |
| 213 | + artifactDescription: Source Build Assets |
| 214 | + downloadFilePatterns: assets/Release/**/*.tar.gz |
| 215 | + copyDestination: $(Build.SourcesDirectory)/artifacts |
| 216 | + ${{ if eq(leg.distro, 'centos') }}: |
| 217 | + artifactName: ${{ format(leg.buildNameFormat, variables.centOSStreamName) }}_${{ leg.targetArchitecture}}_Artifacts |
| 218 | + ${{ elseif eq(leg.distro, 'fedora') }}: |
| 219 | + artifactName: ${{ format(leg.buildNameFormat, variables.fedoraName) }}_${{ leg.targetArchitecture}}_Artifacts |
| 220 | + ${{ elseif eq(leg.distro, 'ubuntu') }}: |
| 221 | + artifactName: ${{ format(leg.buildNameFormat, variables.ubuntuName) }}_${{ leg.targetArchitecture}}_Artifacts |
| 222 | + ${{ elseif eq(leg.distro, 'almalinux') }}: |
| 223 | + artifactName: ${{ format(leg.buildNameFormat, variables.almaLinuxName) }}_${{ leg.targetArchitecture}}_Artifacts |
| 224 | + ${{ elseif eq(leg.distro, 'alpine') }}: |
| 225 | + artifactName: ${{ format(leg.buildNameFormat, variables.alpineName) }}_${{ leg.targetArchitecture}}_Artifacts |
| 226 | + - ${{ if eq(leg.enablePoison, true) }}: |
| 227 | + - template: ../steps/download-artifacts.yml |
| 228 | + parameters: |
| 229 | + artifactDescription: Source Build Poison Report |
| 230 | + downloadFilePatterns: BuildLogs/artifacts/prebuilt-report/poison-usage.xml |
| 231 | + copyDestination: $(Build.SourcesDirectory)/artifacts/prebuilt-report |
| 232 | + flattenDirs: true |
| 233 | + ${{ if eq(leg.distro, 'centos') }}: |
| 234 | + artifactName: ${{ format(leg.buildNameFormat, variables.centOSStreamName) }}_${{ leg.targetArchitecture}}_Artifacts |
| 235 | + ${{ elseif eq(leg.distro, 'fedora') }}: |
| 236 | + artifactName: ${{ format(leg.buildNameFormat, variables.fedoraName) }}_${{ leg.targetArchitecture}}_Artifacts |
| 237 | + ${{ elseif eq(leg.distro, 'ubuntu') }}: |
| 238 | + artifactName: ${{ format(leg.buildNameFormat, variables.ubuntuName) }}_${{ leg.targetArchitecture}}_Artifacts |
| 239 | + ${{ elseif eq(leg.distro, 'almalinux') }}: |
| 240 | + artifactName: ${{ format(leg.buildNameFormat, variables.almaLinuxName) }}_${{ leg.targetArchitecture}}_Artifacts |
| 241 | + ${{ elseif eq(leg.distro, 'alpine') }}: |
| 242 | + artifactName: ${{ format(leg.buildNameFormat, variables.alpineName) }}_${{ leg.targetArchitecture}}_Artifacts |
0 commit comments