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 | usePythonVersion: ''
|
---|
17 | container: ''
|
---|
18 |
|
---|
19 | # Build step
|
---|
20 | jobs:
|
---|
21 |
|
---|
22 | - job: Build_${{ parameters.tool_chain_tag }}
|
---|
23 | timeoutInMinutes: 120
|
---|
24 | #Use matrix to speed up the build process
|
---|
25 | strategy:
|
---|
26 | matrix:
|
---|
27 | ${{ if eq(parameters.tool_chain_tag, 'GCC5') }}:
|
---|
28 | TARGET_GCC_ONLY:
|
---|
29 | Build.Pkgs: 'EmbeddedPkg'
|
---|
30 | Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
---|
31 | TARGET_ARM_ARMPLATFORM:
|
---|
32 | Build.Pkgs: 'ArmPkg,ArmPlatformPkg'
|
---|
33 | Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
---|
34 | TARGET_MDE_CPU:
|
---|
35 | Build.Pkgs: 'MdePkg,UefiCpuPkg'
|
---|
36 | Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
---|
37 | TARGET_MDEMODULE_DEBUG:
|
---|
38 | Build.Pkgs: 'MdeModulePkg'
|
---|
39 | Build.Targets: 'DEBUG,NOOPT'
|
---|
40 | TARGET_MDEMODULE_RELEASE:
|
---|
41 | Build.Pkgs: 'MdeModulePkg'
|
---|
42 | Build.Targets: 'RELEASE,NO-TARGET'
|
---|
43 | TARGET_NETWORK:
|
---|
44 | Build.Pkgs: 'NetworkPkg,RedfishPkg'
|
---|
45 | Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
---|
46 | TARGET_OTHER:
|
---|
47 | Build.Pkgs: 'PcAtChipsetPkg,PrmPkg,ShellPkg,SourceLevelDebugPkg,StandaloneMmPkg,SignedCapsulePkg'
|
---|
48 | Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
---|
49 | TARGET_FMP_FAT_TEST:
|
---|
50 | Build.Pkgs: 'FmpDevicePkg,FatPkg,UnitTestFrameworkPkg,DynamicTablesPkg'
|
---|
51 | Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
---|
52 | TARGET_CRYPTO:
|
---|
53 | Build.Pkgs: 'CryptoPkg'
|
---|
54 | Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
---|
55 | TARGET_FSP:
|
---|
56 | Build.Pkgs: 'IntelFsp2Pkg,IntelFsp2WrapperPkg'
|
---|
57 | Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
---|
58 | TARGET_SECURITY:
|
---|
59 | Build.Pkgs: 'SecurityPkg'
|
---|
60 | Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
---|
61 | TARGET_UEFIPAYLOAD:
|
---|
62 | Build.Pkgs: 'UefiPayloadPkg'
|
---|
63 | Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
---|
64 | TARGET_PLATFORMS:
|
---|
65 | # For Platforms only check code. Leave it to Platform CI
|
---|
66 | # to build them.
|
---|
67 | Build.Pkgs: 'ArmVirtPkg,EmulatorPkg,OvmfPkg'
|
---|
68 | Build.Targets: 'NO-TARGET,NOOPT'
|
---|
69 |
|
---|
70 | workspace:
|
---|
71 | clean: all
|
---|
72 |
|
---|
73 | pool:
|
---|
74 | vmImage: ${{ parameters.vm_image }}
|
---|
75 |
|
---|
76 | ${{ if not(eq(parameters.container, '')) }}:
|
---|
77 | container: ${{ parameters.container }}
|
---|
78 |
|
---|
79 | steps:
|
---|
80 | - template: pr-gate-steps.yml
|
---|
81 | parameters:
|
---|
82 | tool_chain_tag: ${{ parameters.tool_chain_tag }}
|
---|
83 | build_pkgs: $(Build.Pkgs)
|
---|
84 | build_targets: $(Build.Targets)
|
---|
85 | build_archs: ${{ parameters.arch_list }}
|
---|
86 | usePythonVersion: ${{ parameters.usePythonVersion }}
|
---|
87 | extra_install_step: ${{ parameters.extra_install_step }}
|
---|
88 |
|
---|
89 | - job: Build_${{ parameters.tool_chain_tag }}_TARGET_CODE_COVERAGE
|
---|
90 | dependsOn: Build_${{ parameters.tool_chain_tag }}
|
---|
91 | workspace:
|
---|
92 | clean: all
|
---|
93 |
|
---|
94 | pool:
|
---|
95 | vmImage: 'windows-2019'
|
---|
96 |
|
---|
97 | steps:
|
---|
98 | - checkout: self
|
---|
99 | clean: true
|
---|
100 | fetchDepth: 1
|
---|
101 | submodules: true
|
---|
102 |
|
---|
103 | - task: DownloadPipelineArtifact@2
|
---|
104 | displayName: 'Download Build Artifacts'
|
---|
105 | inputs:
|
---|
106 | buildType: 'current'
|
---|
107 | targetPath: '$(Build.ArtifactStagingDirectory)'
|
---|
108 |
|
---|
109 | - powershell: Write-Host "##vso[task.setvariable variable=is_code_coverage]0"
|
---|
110 | displayName: Give default value for whether CodeCoverage or not
|
---|
111 |
|
---|
112 | - powershell: if (Test-Path -Path $(Build.ArtifactStagingDirectory)/**/coverage.xml) {Write-Host "##vso[task.setvariable variable=is_code_coverage]1"}
|
---|
113 | displayName: Check coverage.xml exist or not
|
---|
114 |
|
---|
115 | - task: CmdLine@2
|
---|
116 | displayName: Create code coverage report
|
---|
117 | inputs:
|
---|
118 | script: |
|
---|
119 | dotnet tool install -g dotnet-reportgenerator-globaltool
|
---|
120 | reportgenerator -reports:$(Build.ArtifactStagingDirectory)/**/coverage.xml -targetdir:$(Build.ArtifactStagingDirectory)/Coverage -reporttypes:Cobertura -filefilters:-*Build*;-*UnitTest*;-*Mock*;-*usr*
|
---|
121 | condition: eq(variables.is_code_coverage, 1)
|
---|
122 |
|
---|
123 | - task: PublishCodeCoverageResults@1
|
---|
124 | displayName: 'Publish code coverage'
|
---|
125 | inputs:
|
---|
126 | codeCoverageTool: Cobertura
|
---|
127 | summaryFileLocation: '$(Build.ArtifactStagingDirectory)/Coverage/Cobertura.xml'
|
---|
128 | condition: eq(variables.is_code_coverage, 1)
|
---|
129 |
|
---|