Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AzurePipeline: Add build test to basetools CI #29

Open
wants to merge 2 commits into
base: newmaster
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 144 additions & 0 deletions .azurepipelines/Ovmf-Ubuntu-GCC5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
## @file
# Azure Pipeline build file for building a platform.
#
# Platform: OVMF
# OS: Ubuntu
# Toolchain: GCC5
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
trigger:
- master
- newmaster
pr:
- master
- newmaster

resources:
repositories:
- repository: edk2
type: github
endpoint: BobCF
name: BobCF/edk2

jobs:
- job: Platform_CI
variables:
package: 'OvmfPkg'
vm_image: 'ubuntu-18.04'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ubuntu 18.04 is really old now. Could we use something newer like 22.04 or 24.04?

should_run: true
run_flags: "MAKE_STARTUP_NSH=TRUE QEMU_HEADLESS=TRUE"

#Use matrix to speed up the build process
strategy:
matrix:
OVMF_IA32_DEBUG:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32"
Build.Flags: ""
Build.Target: "DEBUG"
Run.Flags: $(run_flags)
Run: $(should_run)
OVMF_IA32_RELEASE:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32"
Build.Flags: ""
Build.Target: "RELEASE"
Run.Flags: $(run_flags)
Run: $(should_run)
OVMF_IA32_NOOPT:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32"
Build.Flags: ""
Build.Target: "NOOPT"
Run.Flags: $(run_flags)
Run: $(should_run)

OVMF_X64_DEBUG:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "X64"
Build.Flags: ""
Build.Target: "DEBUG"
Run.Flags: $(run_flags)
Run: $(should_run)
OVMF_X64_RELEASE:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "X64"
Build.Flags: ""
Build.Target: "RELEASE"
Run.Flags: $(run_flags)
Run: $(should_run)
OVMF_X64_NOOPT:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "X64"
Build.Flags: ""
Build.Target: "NOOPT"
Run.Flags: $(run_flags)
Run: $(should_run)

OVMF_IA32X64_DEBUG:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32,X64"
Build.Flags: ""
Build.Target: "DEBUG"
Run.Flags: $(run_flags)
Run: $(should_run)
OVMF_IA32X64_RELEASE:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32,X64"
Build.Flags: ""
Build.Target: "RELEASE"
Run.Flags: $(run_flags)
Run: $(should_run)
OVMF_IA32X64_NOOPT:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32,X64"
Build.Flags: ""
Build.Target: "NOOPT"
Run.Flags: $(run_flags)
Run: $(should_run)

OVMF_IA32X64_FULL_DEBUG:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32,X64"
Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_SMM_REQUIRE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
Build.Target: "DEBUG"
Run.Flags: $(run_flags)
Run: $(should_run)
OVMF_IA32X64_FULL_RELEASE:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32,X64"
Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_SMM_REQUIRE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
Build.Target: "RELEASE"
Run.Flags: $(run_flags)
Run: $(should_run)
OVMF_IA32X64_FULL_NOOPT:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32,X64"
Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_SMM_REQUIRE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
Build.Target: "NOOPT"
Run.Flags: $(run_flags)
Run: $(should_run)
workspace:
clean: all

pool:
vmImage: $(vm_image)

steps:
- template: templates/platform-build-run-steps.yml
parameters:
tool_chain_tag: GCC5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be "GCC" now, since the "GCC5" toolchain is deprecated.

build_pkg: $(package)
build_target: $(Build.Target)
build_arch: $(Build.Arch)
build_file: $(Build.File)
build_flags: $(Build.Flags)
run_flags: $(Run.Flags)
extra_install_step:
- bash: sudo apt-get install qemu
displayName: Install qemu
condition: and(gt(variables.pkg_count, 0), succeeded())
- bash: sudo apt-get install mtools
displayName: 'Install mtools'
148 changes: 148 additions & 0 deletions .azurepipelines/Ovmf-Windows-VS2019.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
## @file
# Azure Pipeline build file for building a platform.
#
# Platform: OVMF
# OS: Windows
# Toolchain: VS2019
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
trigger:
- master
- newmaster
pr:
- master
- newmaster

resources:
repositories:
- repository: edk2
type: github
endpoint: BobCF
name: BobCF/edk2

jobs:
- job: Platform_CI
variables:
package: 'OvmfPkg'
vm_image: 'windows-latest'
should_run: true
run_flags: "MAKE_STARTUP_NSH=TRUE QEMU_HEADLESS=TRUE"

#Use matrix to speed up the build process
strategy:
matrix:
OVMF_IA32_DEBUG:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32"
Build.Flags: ""
Build.Target: "DEBUG"
Run.Flags: $(run_flags)
Run: $(should_run)
OVMF_IA32_RELEASE:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32"
Build.Flags: ""
Build.Target: "RELEASE"
Run.Flags: $(run_flags)
Run: $(should_run)
OVMF_IA32_NOOPT:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32"
Build.Flags: ""
Build.Target: "NOOPT"
Run.Flags: $(run_flags)
Run: $(should_run)

OVMF_X64_DEBUG:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "X64"
Build.Flags: ""
Build.Target: "DEBUG"
Run.Flags: $(run_flags)
Run: $(should_run)
OVMF_X64_RELEASE:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "X64"
Build.Flags: ""
Build.Target: "RELEASE"
Run.Flags: $(run_flags)
Run: $(should_run)
OVMF_X64_NOOPT:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "X64"
Build.Flags: ""
Build.Target: "NOOPT"
Run.Flags: $(run_flags)
Run: $(should_run)

OVMF_IA32X64_DEBUG:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32,X64"
Build.Flags: ""
Build.Target: "DEBUG"
Run.Flags: $(run_flags)
Run: $(should_run)
OVMF_IA32X64_RELEASE:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32,X64"
Build.Flags: ""
Build.Target: "RELEASE"
Run.Flags: $(run_flags)
Run: $(should_run)
OVMF_IA32X64_NOOPT:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32,X64"
Build.Flags: ""
Build.Target: "NOOPT"
Run.Flags: $(run_flags)
Run: $(should_run)

OVMF_IA32X64_FULL_DEBUG:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32,X64"
Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_SMM_REQUIRE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
Build.Target: "DEBUG"
Run.Flags: $(run_flags)
Run: $(should_run)
OVMF_IA32X64_FULL_RELEASE:
Build.File: "edk2/$(package)/PlatformCI/PlatformBuild.py"
Build.Arch: "IA32,X64"
Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_SMM_REQUIRE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
Build.Target: "RELEASE"
Run.Flags: $(run_flags)
Run: $(should_run)

# This currently creates a very large image which is too big for the FDF declared range
# Ovmf maintainers suggest to skip this build for now.
#
# OVMF_IA32X64_FULL_NOOPT:
# Build.File: "$(package)/PlatformCI/PlatformBuild.py"
# Build.Arch: "IA32,X64"
# Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_SMM_REQUIRE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
# Build.Target: "NOOPT"
# Run.Flags: $(run_flags)
# Run: $(should_run)

workspace:
clean: all

pool:
vmImage: $(vm_image)

steps:
- template: templates/platform-build-run-steps.yml
parameters:
tool_chain_tag: VS2019
build_pkg: $(package)
build_target: $(Build.Target)
build_arch: $(Build.Arch)
build_file: $(Build.File)
build_flags: $(Build.Flags)
run_flags: $(Run.Flags)
extra_install_step:
- powershell: choco install qemu --version=2021.5.5; Write-Host "##vso[task.prependpath]c:\Program Files\qemu"
displayName: Install QEMU and Set QEMU on path # friendly name displayed in the UI
condition: and(gt(variables.pkg_count, 0), succeeded())

28 changes: 28 additions & 0 deletions .azurepipelines/build-ubuntu-gcc5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## @file
# Azure Pipeline build file for a build using ubuntu and GCC5
#
# Copyright (c) Microsoft Corporation.
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
trigger:
- master
- newmaster
pr:
- master
- newmaster

resources:
repositories:
- repository: edk2
type: github
endpoint: BobCF
name: BobCF/edk2

jobs:
- template: templates/pr-gate-build-job.yml
parameters:
tool_chain_tag: 'GCC5'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, this should be "GCC".

vm_image: 'ubuntu-latest'
arch_list: "IA32,X64,ARM,AARCH64,RISCV64"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want loonsong too?


27 changes: 27 additions & 0 deletions .azurepipelines/build-windows-vs2019.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## @file
# Azure Pipeline build file for a build using Windows and VS2019
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
trigger:
- master
- newmaster

pr:
- master
- newmaster

resources:
repositories:
- repository: edk2
type: github
endpoint: BobCF
name: BobCF/edk2

jobs:
- template: templates/pr-gate-build-job.yml
parameters:
tool_chain_tag: 'VS2019'
vm_image: 'windows-latest'
arch_list: "IA32,X64"
37 changes: 37 additions & 0 deletions .azurepipelines/templates/basetools-build-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## @file
# File templates/basetools-build-job.yml
#
# template file to build basetools
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
parameters:
tool_chain_tag: ''

steps:
- ${{ if contains(parameters.tool_chain_tag, 'GCC') }}:
- bash: sudo apt-get update
displayName: Update apt
condition: and(gt(variables.pkg_count, 0), succeeded())

- bash: sudo apt-get install gcc g++ make uuid-dev
displayName: Install required tools
condition: and(gt(variables.pkg_count, 0), succeeded())

- task: CmdLine@1
displayName: Build Base Tools from source
inputs:
filename: python
arguments: edk2/BaseTools/Edk2ToolsBuild.py -t ${{ parameters.tool_chain_tag }}
condition: and(gt(variables.pkg_count, 0), succeeded())

- task: CopyFiles@2
displayName: "Copy base tools build log"
inputs:
targetFolder: '$(Build.ArtifactStagingDirectory)'
SourceFolder: 'edk2/BaseTools/BaseToolsBuild'
contents: |
BASETOOLS_BUILD*.*
flattenFolders: true
condition: and(gt(variables.pkg_count, 0), succeededOrFailed())
Loading