2019-10-08 05:34:34 +02:00
|
|
|
## @file
|
|
|
|
# File templates/pr-gate-build-job.yml
|
|
|
|
#
|
|
|
|
# template file used to build supported packages.
|
|
|
|
#
|
|
|
|
# Copyright (c) Microsoft Corporation.
|
2020-12-03 11:27:32 +01:00
|
|
|
# Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.<BR>
|
2019-10-08 05:34:34 +02:00
|
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
##
|
|
|
|
|
|
|
|
parameters:
|
|
|
|
tool_chain_tag: ''
|
|
|
|
vm_image: ''
|
|
|
|
arch_list: ''
|
2022-11-08 09:38:49 +01:00
|
|
|
extra_install_step: []
|
2023-01-16 18:40:28 +01:00
|
|
|
usePythonVersion: ''
|
2023-01-16 18:40:33 +01:00
|
|
|
container: ''
|
2019-10-08 05:34:34 +02:00
|
|
|
|
|
|
|
# Build step
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
- job: Build_${{ parameters.tool_chain_tag }}
|
2021-11-19 20:53:00 +01:00
|
|
|
timeoutInMinutes: 120
|
2019-10-08 05:34:34 +02:00
|
|
|
#Use matrix to speed up the build process
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-09-07 00:48:10 +02:00
|
|
|
${{ if eq(parameters.tool_chain_tag, 'GCC5') }}:
|
|
|
|
TARGET_GCC_ONLY:
|
|
|
|
Build.Pkgs: 'EmbeddedPkg'
|
|
|
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
2021-04-21 12:07:33 +02:00
|
|
|
TARGET_ARM_ARMPLATFORM:
|
|
|
|
Build.Pkgs: 'ArmPkg,ArmPlatformPkg'
|
2021-03-12 16:27:59 +01:00
|
|
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
2019-10-08 05:34:34 +02:00
|
|
|
TARGET_MDE_CPU:
|
|
|
|
Build.Pkgs: 'MdePkg,UefiCpuPkg'
|
2020-01-22 19:20:44 +01:00
|
|
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
2019-10-08 05:34:34 +02:00
|
|
|
TARGET_MDEMODULE_DEBUG:
|
|
|
|
Build.Pkgs: 'MdeModulePkg'
|
2020-01-22 19:20:44 +01:00
|
|
|
Build.Targets: 'DEBUG,NOOPT'
|
2019-10-08 05:34:34 +02:00
|
|
|
TARGET_MDEMODULE_RELEASE:
|
|
|
|
Build.Pkgs: 'MdeModulePkg'
|
|
|
|
Build.Targets: 'RELEASE,NO-TARGET'
|
|
|
|
TARGET_NETWORK:
|
2020-10-06 03:13:30 +02:00
|
|
|
Build.Pkgs: 'NetworkPkg,RedfishPkg'
|
2022-04-20 02:12:56 +02:00
|
|
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
2019-10-08 05:34:34 +02:00
|
|
|
TARGET_OTHER:
|
2022-10-04 17:05:37 +02:00
|
|
|
Build.Pkgs: 'PcAtChipsetPkg,PrmPkg,ShellPkg,SourceLevelDebugPkg,StandaloneMmPkg,SignedCapsulePkg'
|
2022-04-20 02:12:56 +02:00
|
|
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
2020-01-22 19:20:44 +01:00
|
|
|
TARGET_FMP_FAT_TEST:
|
2020-08-07 19:29:35 +02:00
|
|
|
Build.Pkgs: 'FmpDevicePkg,FatPkg,UnitTestFrameworkPkg,DynamicTablesPkg'
|
2020-01-22 19:20:44 +01:00
|
|
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
2023-04-03 19:01:25 +02:00
|
|
|
TARGET_CRYPTO_DEBUG:
|
2019-10-08 05:34:34 +02:00
|
|
|
Build.Pkgs: 'CryptoPkg'
|
2023-04-03 19:01:25 +02:00
|
|
|
Build.Targets: 'DEBUG,NOOPT'
|
|
|
|
TARGET_CRYPTO_RELEASE:
|
|
|
|
Build.Pkgs: 'CryptoPkg'
|
|
|
|
Build.Targets: 'RELEASE,NO-TARGET'
|
2022-09-06 23:19:17 +02:00
|
|
|
TARGET_FSP:
|
|
|
|
Build.Pkgs: 'IntelFsp2Pkg,IntelFsp2WrapperPkg'
|
|
|
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
2019-10-08 05:34:34 +02:00
|
|
|
TARGET_SECURITY:
|
|
|
|
Build.Pkgs: 'SecurityPkg'
|
2022-04-20 02:12:56 +02:00
|
|
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
2021-08-20 08:43:37 +02:00
|
|
|
TARGET_UEFIPAYLOAD:
|
|
|
|
Build.Pkgs: 'UefiPayloadPkg'
|
2022-04-20 02:12:56 +02:00
|
|
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
2020-04-08 07:08:46 +02:00
|
|
|
TARGET_PLATFORMS:
|
|
|
|
# For Platforms only check code. Leave it to Platform CI
|
|
|
|
# to build them.
|
|
|
|
Build.Pkgs: 'ArmVirtPkg,EmulatorPkg,OvmfPkg'
|
2022-04-20 02:12:56 +02:00
|
|
|
Build.Targets: 'NO-TARGET,NOOPT'
|
2019-10-08 05:34:34 +02:00
|
|
|
|
|
|
|
workspace:
|
|
|
|
clean: all
|
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: ${{ parameters.vm_image }}
|
|
|
|
|
2023-01-16 18:40:33 +01:00
|
|
|
${{ if not(eq(parameters.container, '')) }}:
|
|
|
|
container: ${{ parameters.container }}
|
|
|
|
|
2019-10-08 05:34:34 +02:00
|
|
|
steps:
|
|
|
|
- template: pr-gate-steps.yml
|
|
|
|
parameters:
|
|
|
|
tool_chain_tag: ${{ parameters.tool_chain_tag }}
|
|
|
|
build_pkgs: $(Build.Pkgs)
|
|
|
|
build_targets: $(Build.Targets)
|
|
|
|
build_archs: ${{ parameters.arch_list }}
|
2023-01-16 18:40:28 +01:00
|
|
|
usePythonVersion: ${{ parameters.usePythonVersion }}
|
2022-11-08 09:38:49 +01:00
|
|
|
extra_install_step: ${{ parameters.extra_install_step }}
|
|
|
|
|
|
|
|
- job: Build_${{ parameters.tool_chain_tag }}_TARGET_CODE_COVERAGE
|
|
|
|
dependsOn: Build_${{ parameters.tool_chain_tag }}
|
|
|
|
workspace:
|
|
|
|
clean: all
|
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: 'windows-2019'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
clean: true
|
|
|
|
fetchDepth: 1
|
|
|
|
submodules: true
|
|
|
|
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
displayName: 'Download Build Artifacts'
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
|
|
|
targetPath: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
|
2023-01-05 02:50:20 +01:00
|
|
|
- powershell: Write-Host "##vso[task.setvariable variable=is_code_coverage]0"
|
|
|
|
displayName: Give default value for whether CodeCoverage or not
|
|
|
|
|
|
|
|
- powershell: if (Test-Path -Path $(Build.ArtifactStagingDirectory)/**/coverage.xml) {Write-Host "##vso[task.setvariable variable=is_code_coverage]1"}
|
|
|
|
displayName: Check coverage.xml exist or not
|
|
|
|
|
2022-11-08 09:38:49 +01:00
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: Create code coverage report
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
dotnet tool install -g dotnet-reportgenerator-globaltool
|
|
|
|
reportgenerator -reports:$(Build.ArtifactStagingDirectory)/**/coverage.xml -targetdir:$(Build.ArtifactStagingDirectory)/Coverage -reporttypes:Cobertura -filefilters:-*Build*;-*UnitTest*;-*Mock*;-*usr*
|
2023-01-05 02:50:20 +01:00
|
|
|
condition: eq(variables.is_code_coverage, 1)
|
2022-11-08 09:38:49 +01:00
|
|
|
|
|
|
|
- task: PublishCodeCoverageResults@1
|
|
|
|
displayName: 'Publish code coverage'
|
|
|
|
inputs:
|
|
|
|
codeCoverageTool: Cobertura
|
|
|
|
summaryFileLocation: '$(Build.ArtifactStagingDirectory)/Coverage/Cobertura.xml'
|
2023-01-05 02:50:20 +01:00
|
|
|
condition: eq(variables.is_code_coverage, 1)
|
2022-11-08 09:38:49 +01:00
|
|
|
|