Skip to content

Commit

Permalink
Use Mu DevOps (microsoft#139)
Browse files Browse the repository at this point in the history
* Revert "Updated pipelines to only run CI and PR gates on release/202208 and release/202202 (microsoft#131)"

Reverts commit 4bbdb46 to reduce
conflicts with a new approach to pipeline management with YAML
files.

* Use Mu DevOps

Updates this repo to use mu_devops for Azure Pipeline definitions.

In order to centralize definitions and avoid build churn in individual Mu repos,
some changes are made to allow build administrators to quickly adjust settings:

- Toolchain, VM image, and architecture are controlled by build administrators through centralized
   variable groups
- CI triggers, CI schedules, and PR triggers are controlled by build administrators within the
  individual pipeline UI settings

- [ ] Breaking change?
  - Will this change break pre-existing builds or functionality without action being taken?
  **No**

Verified in test pipelines.

N/A - No developer integration required

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
  • Loading branch information
makubacki authored and TaylorBeebe committed Apr 27, 2023
1 parent 67715e9 commit c34371f
Show file tree
Hide file tree
Showing 18 changed files with 216 additions and 801 deletions.
28 changes: 18 additions & 10 deletions .azurepipelines/BaseTools-Build-For-Publication.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# File BaseTools-Build-For-Publication.yml
#
## @file
# Azure Pipeline to construct the final Nuget package for a binary release
# of BaseTools.
#
# Copyright (C) Microsoft Corporation
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

resources:
repositories:
- repository: mu_devops
type: github
endpoint: microsoft
name: microsoft/mu_devops
ref: main

name: BaseTools_Bin_$(release_version)_$(Rev:r)

variables:
Expand Down Expand Up @@ -54,10 +62,10 @@ jobs:
filename: stuart_update
arguments: -c .pytool/CISettings.py

- template: templates/basetools-build-steps.yml
- template: Steps/BuildBaseTools.yml@mu_devops
parameters:
tool_chain_tag: 'GCC5'
extra_parameters: '--skip_path_env'
tool_chain_tag: 'GCC5'

- publish: $(linux_build_output_path)
artifact: $(linux_artifact_name)
Expand Down Expand Up @@ -98,10 +106,10 @@ jobs:
filename: stuart_update
arguments: -c .pytool/CISettings.py

- template: templates/basetools-build-steps.yml
- template: Steps/BuildBaseTools.yml@mu_devops
parameters:
tool_chain_tag: 'VS2022'
extra_parameters: '--skip_path_env'
tool_chain_tag: 'VS2022'

- publish: $(windows_build_output_path)
artifact: $(windows_artifact_name)
Expand Down Expand Up @@ -129,21 +137,21 @@ jobs:
architecture: 'x64'
displayName: Install correct Python

- template: templates/github-file-fetch.yml
- template: Steps/FetchGitHubFile.yml@mu_devops
parameters:
dest_file_path: $(Build.StagingDirectory)/pip-requirements.txt
display_name: Fetch Pip Requirements
github_repo: microsoft/mu_basecore
source_branch: $(Build.SourceBranch)
source_file_path: pip-requirements.txt
dest_file_path: $(Build.StagingDirectory)/pip-requirements.txt
display_name: Fetch Pip Requirements

- script: pip install -r $(Build.StagingDirectory)/pip-requirements.txt --upgrade
displayName: 'Install/Upgrade Pip Modules'

- download: current
displayName: Grab Artifacts from Builds

- template: templates/github-file-fetch.yml
- template: Steps/FetchGitHubFile.yml@mu_devops
parameters:
github_repo: microsoft/mu_basecore
source_branch: $(Build.SourceBranch)
Expand Down
81 changes: 81 additions & 0 deletions .azurepipelines/Matrix-Build-Job-Clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
## @file
# Template file for generating a CLANGPDB build job matrix for the packages currently supported for
# build in Mu Basecore.
#
# Copyright (c) Microsoft Corporation.
# Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

parameters:
- name: arch_list
displayName: Architectures (e.g. IA32, X64)
type: string
default: ''
- name: extra_build_args
displayName: Extra Build Command Arguments
type: string
default: ''
- name: extra_install_step
displayName: Extra Install Steps
type: stepList
default:
- script: echo No extra steps provided
- name: tool_chain_tag
displayName: Tool Chain (e.g. VS2022)
type: string
default: ''
- name: vm_image
displayName: Virtual Machine Image (e.g. windows-latest)
type: string
default: 'windows-latest'

jobs:

- job: Build
timeoutInMinutes: 120
# Use matrix to speed up the build process
strategy:
matrix:
TARGET_MDE_CPU:
Build.Pkgs: 'MdePkg,UefiCpuPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_MDEMODULE_DEBUG:
Build.Pkgs: 'MdeModulePkg'
Build.Targets: 'DEBUG,NOOPT'
TARGET_MDEMODULE_RELEASE:
Build.Pkgs: 'MdeModulePkg'
Build.Targets: 'RELEASE,NO-TARGET'
TARGET_NETWORK:
Build.Pkgs: 'NetworkPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_OTHER:
Build.Pkgs: 'PcAtChipsetPkg,ShellPkg,StandaloneMmPkg,BaseTools'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_TEST_POLICY:
Build.Pkgs: 'UnitTestFrameworkPkg,PolicyServicePkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_CRYPTO:
Build.Pkgs: 'CryptoPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'

workspace:
clean: all

pool:
vmImage: ${{ parameters.vm_image }}

steps:
- template: Steps/PrGate.yml@mu_devops
parameters:
build_archs: ${{ parameters.arch_list }}
build_pkgs: $(Build.Pkgs)
build_targets: $(Build.Targets)
do_ci_build: true
do_ci_setup: false
do_non_ci_build: false
do_non_ci_setup: true
do_pr_eval: true
extra_build_args: ${{ parameters.extra_build_args }}
extra_install_step: ${{ parameters.extra_install_step }}
tool_chain_tag: ${{ parameters.tool_chain_tag }}
Original file line number Diff line number Diff line change
@@ -1,26 +1,40 @@
## @file
# File templates/pr-gate-build-job.yml
#
# template file used to build supported packages.
# Template file for generating a build job matrix for the packages currently supported for
# build in Mu Basecore.
#
# Copyright (c) Microsoft Corporation.
# Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

parameters:
tool_chain_tag: ''
vm_image: ''
arch_list: ''
extra_steps: [] # MU_CHANGE
build_args: '' # MU_CHANGE - Allow environment level build args.
- name: arch_list
displayName: Architectures (e.g. IA32, X64)
type: string
default: ''
- name: extra_build_args
displayName: Extra Build Command Arguments
type: string
default: ''
- name: extra_install_step
displayName: Extra Install Steps
type: stepList
default:
- script: echo No extra steps provided
- name: tool_chain_tag
displayName: Tool Chain (e.g. VS2022)
type: string
default: ''
- name: vm_image
displayName: Virtual Machine Image (e.g. windows-latest)
type: string
default: 'windows-latest'

# Build step
jobs:

- job: Build_${{ parameters.tool_chain_tag }}
- job: Build
timeoutInMinutes: 120
#Use matrix to speed up the build process
# Use matrix to speed up the build process
strategy:
matrix:
TARGET_MDE_CPU:
Expand All @@ -36,10 +50,10 @@ jobs:
Build.Pkgs: 'NetworkPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_OTHER:
Build.Pkgs: 'PcAtChipsetPkg,ShellPkg,StandaloneMmPkg,BaseTools' # MU_CHANGE add BaseTools
Build.Pkgs: 'PcAtChipsetPkg,ShellPkg,StandaloneMmPkg,BaseTools'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_TEST_POLICY:
Build.Pkgs: 'UnitTestFrameworkPkg,PolicyServicePkg' # MU_CHANGE add policy package
Build.Pkgs: 'UnitTestFrameworkPkg,PolicyServicePkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_CRYPTO:
Build.Pkgs: 'CryptoPkg'
Expand All @@ -52,11 +66,16 @@ jobs:
vmImage: ${{ parameters.vm_image }}

steps:
- template: pr-gate-steps.yml
- template: Steps/PrGate.yml@mu_devops
parameters:
tool_chain_tag: ${{ parameters.tool_chain_tag }}
build_archs: ${{ parameters.arch_list }}
build_pkgs: $(Build.Pkgs)
build_targets: $(Build.Targets)
build_archs: ${{ parameters.arch_list }}
extra_steps: ${{ parameters.extra_steps }} # MU_CHANGE
build_args: ${{ parameters.build_args }} # MU_CHANGE
do_ci_build: true
do_ci_setup: false
do_non_ci_build: false
do_non_ci_setup: true
do_pr_eval: true
extra_build_args: ${{ parameters.extra_build_args }}
extra_install_step: ${{ parameters.extra_install_step }}
tool_chain_tag: ${{ parameters.tool_chain_tag }}
50 changes: 0 additions & 50 deletions .azurepipelines/ReadMe.md

This file was deleted.

47 changes: 18 additions & 29 deletions .azurepipelines/Ubuntu-CLANGPDB.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,29 @@
## @file
# Azure Pipeline build file for a build using ubuntu and CLANGPDB
# Azure Pipeline build file for a build using Ubuntu and CLANGPDB.
#
# Copyright (c) Microsoft Corporation.
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
# MU_CHANGE BEGIN
trigger:
- dev/*
- release/202208
- release/202202

schedules:
- cron: "30 9 * * 0,3" # Sun/Wed at 2:30AM Pacific
displayName: Sun/Wed Build
branches:
include:
- dev/*
- release/202208
- release/202202
always: true # Always build, even if no changes
resources:
repositories:
- repository: mu_devops
type: github
endpoint: microsoft
name: microsoft/mu_devops
ref: main

pr:
- dev/*
- release/202208
- release/202202
# MU_CHANGE END
variables:
- group: architectures-x86-64
- group: tool-chain-clangpdb
- group: tool-chain-clangpdb-windows-vm-image

jobs:
- template: templates/pr-gate-build-job-clang.yml
- template: Matrix-Build-Job-Clang.yml
parameters:
tool_chain_tag: 'CLANGPDB'
vm_image: 'ubuntu-latest'
arch_list: "IA32,X64"
# MU_CHANGE
arch_list: $(arch_list)
extra_steps:
- script: sudo apt-get install mingw-w64
displayName: Install Windows Resource Compiler for Linux

- script: sudo apt-get install mingw-w64
displayName: Install Windows Resource Compiler for Linux
tool_chain_tag: $(tool_chain_tag)
vm_image: $(vm_image)
Loading

0 comments on commit c34371f

Please sign in to comment.