]> git.proxmox.com Git - mirror_edk2.git/blob - .azurepipelines/templates/pr-gate-build-job.yml
.azurepipelines: Install code coverage tool
[mirror_edk2.git] / .azurepipelines / templates / pr-gate-build-job.yml
1 ## @file
2 # File templates/pr-gate-build-job.yml
3 #
4 # template file used to build supported packages.
5 #
6 # Copyright (c) Microsoft Corporation.
7 # Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.<BR>
8 # SPDX-License-Identifier: BSD-2-Clause-Patent
9 ##
10
11 parameters:
12 tool_chain_tag: ''
13 vm_image: ''
14 arch_list: ''
15 extra_install_step: []
16
17 # Build step
18 jobs:
19
20 - job: Build_${{ parameters.tool_chain_tag }}
21 timeoutInMinutes: 120
22 #Use matrix to speed up the build process
23 strategy:
24 matrix:
25 ${{ if eq(parameters.tool_chain_tag, 'GCC5') }}:
26 TARGET_GCC_ONLY:
27 Build.Pkgs: 'EmbeddedPkg'
28 Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
29 TARGET_ARM_ARMPLATFORM:
30 Build.Pkgs: 'ArmPkg,ArmPlatformPkg'
31 Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
32 TARGET_MDE_CPU:
33 Build.Pkgs: 'MdePkg,UefiCpuPkg'
34 Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
35 TARGET_MDEMODULE_DEBUG:
36 Build.Pkgs: 'MdeModulePkg'
37 Build.Targets: 'DEBUG,NOOPT'
38 TARGET_MDEMODULE_RELEASE:
39 Build.Pkgs: 'MdeModulePkg'
40 Build.Targets: 'RELEASE,NO-TARGET'
41 TARGET_NETWORK:
42 Build.Pkgs: 'NetworkPkg,RedfishPkg'
43 Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
44 TARGET_OTHER:
45 Build.Pkgs: 'PcAtChipsetPkg,PrmPkg,ShellPkg,SourceLevelDebugPkg,StandaloneMmPkg,SignedCapsulePkg'
46 Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
47 TARGET_FMP_FAT_TEST:
48 Build.Pkgs: 'FmpDevicePkg,FatPkg,UnitTestFrameworkPkg,DynamicTablesPkg'
49 Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
50 TARGET_CRYPTO:
51 Build.Pkgs: 'CryptoPkg'
52 Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
53 TARGET_FSP:
54 Build.Pkgs: 'IntelFsp2Pkg,IntelFsp2WrapperPkg'
55 Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
56 TARGET_SECURITY:
57 Build.Pkgs: 'SecurityPkg'
58 Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
59 TARGET_UEFIPAYLOAD:
60 Build.Pkgs: 'UefiPayloadPkg'
61 Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
62 TARGET_PLATFORMS:
63 # For Platforms only check code. Leave it to Platform CI
64 # to build them.
65 Build.Pkgs: 'ArmVirtPkg,EmulatorPkg,OvmfPkg'
66 Build.Targets: 'NO-TARGET,NOOPT'
67
68 workspace:
69 clean: all
70
71 pool:
72 vmImage: ${{ parameters.vm_image }}
73
74 steps:
75 - template: pr-gate-steps.yml
76 parameters:
77 tool_chain_tag: ${{ parameters.tool_chain_tag }}
78 build_pkgs: $(Build.Pkgs)
79 build_targets: $(Build.Targets)
80 build_archs: ${{ parameters.arch_list }}
81 extra_install_step: ${{ parameters.extra_install_step }}
82
83 - job: Build_${{ parameters.tool_chain_tag }}_TARGET_CODE_COVERAGE
84 dependsOn: Build_${{ parameters.tool_chain_tag }}
85 workspace:
86 clean: all
87
88 pool:
89 vmImage: 'windows-2019'
90
91 steps:
92 - checkout: self
93 clean: true
94 fetchDepth: 1
95 submodules: true
96
97 - task: DownloadPipelineArtifact@2
98 displayName: 'Download Build Artifacts'
99 inputs:
100 buildType: 'current'
101 targetPath: '$(Build.ArtifactStagingDirectory)'
102
103 - task: CmdLine@2
104 displayName: Create code coverage report
105 inputs:
106 script: |
107 dotnet tool install -g dotnet-reportgenerator-globaltool
108 reportgenerator -reports:$(Build.ArtifactStagingDirectory)/**/coverage.xml -targetdir:$(Build.ArtifactStagingDirectory)/Coverage -reporttypes:Cobertura -filefilters:-*Build*;-*UnitTest*;-*Mock*;-*usr*
109
110 - task: PublishCodeCoverageResults@1
111 displayName: 'Publish code coverage'
112 inputs:
113 codeCoverageTool: Cobertura
114 summaryFileLocation: '$(Build.ArtifactStagingDirectory)/Coverage/Cobertura.xml'
115