forked from corthon/edk2-staging
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines-pr-gate.yml
More file actions
185 lines (165 loc) · 5.87 KB
/
azure-pipelines-pr-gate.yml
File metadata and controls
185 lines (165 loc) · 5.87 KB
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
variables:
OMNICACHE_PATH : $(Pipeline.Workspace)/OmniCache
jobs:
- job: Setup_Maintain_Omnicache
condition: eq(variables['Build.Reason'], 'Schedule')
workspace:
clean: all
pool:
vmImage: 'windows-latest'
steps:
- checkout: none
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7.x'
architecture: 'x64'
- script: pip install --upgrade edk2-pytool-extensions
displayName: 'Get Omnicache tool'
#Start the Omnicache
- powershell: |
$date = get-date -UFormat %Y%W
echo "##vso[task.setvariable variable=OmniCacheKey;isOutput=true]seancache$($date)"
displayName: Get Cache Key for Omnicache
name: Omnicache
workingDirectory: $(build.sourcesDirectory)
failOnStderr: false
- task: CacheBeta@0
inputs:
key: $(Omnicache.OmniCacheKey)
path: $(OMNICACHE_PATH)
cacheHitVar: OMNICACHE_RESTORED
displayName: Retrieve Omnicache
- task: CmdLine@1
displayName: "Setup Omnicache"
condition: and(succeeded(), ne(variables.OMNICACHE_RESTORED, 'true'))
inputs:
filename: "omnicache"
arguments: "-a openssl https://github.com/openssl/openssl.git true -a borningssl https://boringssl.googlesource.com/boringssl -a pyca https://github.com/pyca/cryptography.git -a krb5 https://github.com/krb5/krb5 -a softfloat https://github.com/ucb-bar/berkeley-softfloat-3.git -a cmocka https://git.cryptomilk.org/projects/cmocka.git --init $(OMNICACHE_PATH)"
# Build step
- job: Build
#dependsOn: Setup_Maintain_Omnicache
#Use matrix to speed up the build process
strategy:
matrix:
TARGET_MDE_CPU:
Build.Pkgs: 'MdePkg,UefiCpuPkg'
Build.Targets: 'DEBUG,RELEASE,NOOPT,NO-TARGET'
TARGET_MDEMODULE_DEBUG:
Build.Pkgs: 'MdeModulePkg'
Build.Targets: 'DEBUG'
TARGET_MDEMODULE_RELEASE:
Build.Pkgs: 'MdeModulePkg'
Build.Targets: 'RELEASE,NO-TARGET'
TARGET_MDEMODULE_NOOPT_HOST:
Build.Pkgs: 'MdeModulePkg'
Build.Targets: 'NOOPT'
TARGET_NETWORK:
Build.Pkgs: 'NetworkPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_OTHER:
Build.Pkgs: 'PcAtChipsetPkg,ShellPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_FMP:
Build.Pkgs: 'FmpDevicePkg,FatPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_CRYPTO:
Build.Pkgs: 'CryptoPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_SECURITY:
Build.Pkgs: 'SecurityPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
workspace:
clean: all
pool:
vmImage: 'windows-latest'
steps:
- checkout: self
clean: true
fetchDepth: 1
- powershell: |
$date = get-date -UFormat %Y%W
echo "##vso[task.setvariable variable=OmniCacheKey;isOutput=true]seancache$($date)"
displayName: Get Cache Key for Omnicache
name: Omnicache
workingDirectory: $(build.sourcesDirectory)
failOnStderr: false
- task: CacheBeta@0
inputs:
key: $(Omnicache.OmniCacheKey)
path: $(OMNICACHE_PATH)
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7.x'
architecture: 'x64'
- script: pip install -r requirements.txt --upgrade
displayName: 'Install/Upgrade pip modules'
#Build repo
- task: CmdLine@1
displayName: Setup $(Build.Pkgs)
inputs:
filename: stuart_setup
arguments: -c CISettings.py -p $(Build.Pkgs) -t $(Build.Targets) TOOL_CHAIN_TAG=VS2019
- task: CmdLine@1
displayName: Update $(Build.Pkgs)
inputs:
filename: stuart_update
arguments: -c CISettings.py -p $(Build.Pkgs) -t $(Build.Targets) TOOL_CHAIN_TAG=VS2019
- task: CmdLine@1
displayName: Build and Test $(Build.Pkgs)
inputs:
filename: stuart_ci_build
arguments: -c CISettings.py -p $(Build.Pkgs) -t $(Build.Targets) TOOL_CHAIN_TAG=VS2019
# Publish Test Results to Azure Pipelines/TFS
- task: PublishTestResults@2
displayName: 'Publish junit test results'
continueOnError: true
condition: succeededOrFailed()
inputs:
testResultsFormat: 'JUnit' # Options: JUnit, NUnit, VSTest, xUnit
testResultsFiles: 'Build/TestSuites.xml'
#searchFolder: '$(System.DefaultWorkingDirectory)' # Optional
mergeTestResults: true # Optional
testRunTitle: $(System.JobName) # Optional
#buildPlatform: # Optional
#buildConfiguration: # Optional
publishRunAttachments: true # Optional
# Publish Test Results to Azure Pipelines/TFS
- task: PublishTestResults@2
displayName: 'Publish host based test results for $(System.JobName)'
continueOnError: true
condition: succeededOrFailed()
inputs:
testResultsFormat: 'JUnit' # Options: JUnit, NUnit, VSTest, xUnit
testResultsFiles: 'Build/**/*.result.xml'
#searchFolder: '$(System.DefaultWorkingDirectory)' # Optional
mergeTestResults: false # Optional
testRunTitle: $(Build.Pkgs) # Optional
#buildPlatform: # Optional
#buildConfiguration: # Optional
publishRunAttachments: true # Optional
# Copy the build logs to the artifact staging directory
- task: CopyFiles@2
displayName: "Copy build logs"
inputs:
targetFolder: '$(Build.ArtifactStagingDirectory)'
contents: |
Build\**\BUILDLOG_*.txt
Build\**\BUILDLOG_*.md
Build\**\CI_*.txt
Build\**\CI_*.md
Build\**\CISETUP.txt
Build\**\SETUPLOG.txt
Build\**\UPDATE_LOG.txt
Build\**\TestSuites.xml
Build\**\BUILD_TOOLS_REPORT.html
Build\**\OVERRIDELOG.TXT
flattenFolders: true
condition: succeededOrFailed()
# Publish build artifacts to Azure Artifacts/TFS or a file share
- task: PublishBuildArtifacts@1
continueOnError: true
displayName: "Publish build logs"
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'Build Logs $(System.JobName)'
condition: succeededOrFailed()