Skip to content

Commit

Permalink
Merge branch 'tianocore:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
LeanSheng authored Jun 5, 2024
2 parents dc1658e + 10cd8b4 commit 59a069a
Show file tree
Hide file tree
Showing 6,742 changed files with 971,991 additions and 401,861 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
11 changes: 8 additions & 3 deletions .azurepipelines/Ubuntu-GCC5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
# Copyright (c) Microsoft Corporation.
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
trigger:
Expand All @@ -12,10 +13,14 @@ pr:
- master
- stable/*

variables:
- template: templates/defaults.yml

jobs:
- template: templates/pr-gate-build-job.yml
parameters:
tool_chain_tag: 'GCC5'
vm_image: 'ubuntu-latest'
arch_list: "IA32,X64,ARM,AARCH64,RISCV64"

vm_image: 'ubuntu-22.04'
container: ${{ variables.default_linux_image }}
arch_list: "IA32,X64,ARM,AARCH64,RISCV64,LOONGARCH64"
usePythonVersion: '' # use Python from the container image
2 changes: 1 addition & 1 deletion .azurepipelines/Ubuntu-PatchCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ steps:

- task: UsePythonVersion@0
inputs:
versionSpec: '3.7.x'
versionSpec: '3.12'
architecture: 'x64'

- script: |
Expand Down
11 changes: 10 additions & 1 deletion .azurepipelines/Windows-VS2019.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,18 @@ pr:
- master
- stable/*

variables:
- template: templates/defaults.yml

jobs:
- template: templates/pr-gate-build-job.yml
parameters:
tool_chain_tag: 'VS2019'
vm_image: 'windows-latest'
vm_image: 'windows-2019'
arch_list: "IA32,X64"
usePythonVersion: ${{ variables.default_python_version }}
extra_install_step:
- powershell: choco install opencppcoverage; Write-Host "##vso[task.prependpath]C:\Program Files\OpenCppCoverage"
displayName: Install Code Coverage Tool
condition: and(gt(variables.pkg_count, 0), succeeded())

9 changes: 0 additions & 9 deletions .azurepipelines/templates/basetools-build-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ 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:
Expand Down
12 changes: 12 additions & 0 deletions .azurepipelines/templates/defaults.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## @file
# File templates/default.yml
#
# template file containing common default values
#
# Copyright (c) Red Hat, Inc.
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

variables:
default_python_version: "3.12"
default_linux_image: "ghcr.io/tianocore/containers/fedora-37-test:a0dd931"
17 changes: 12 additions & 5 deletions .azurepipelines/templates/platform-build-run-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,33 @@ parameters:
- name: extra_install_step
type: stepList
default: []
- name: usePythonVersion
type: string
default: ''

steps:
- bash: |
echo "##vso[task.prependpath]${HOME}/.local/bin"
echo "new PATH=${PATH}"
displayName: Set PATH
condition: eq('${{ parameters.tool_chain_tag }}', 'GCC5')

- checkout: self
clean: true
fetchDepth: 1

- task: UsePythonVersion@0
inputs:
versionSpec: "3.8.x"
versionSpec: ${{ parameters.usePythonVersion }}
architecture: "x64"
condition: ne('${{ parameters.usePythonVersion }}', '')

- script: pip install -r pip-requirements.txt --upgrade
displayName: 'Install/Upgrade pip modules'

# Set default
- bash: echo "##vso[task.setvariable variable=pkg_count]${{ 1 }}"

# Use altername cmocka repo
- bash: git config --global url.https://github.com/neverware-mirrors/cmocka.git.insteadOf https://git.cryptomilk.org/projects/cmocka.git

# Fetch the target branch so that pr_eval can diff them.
# Seems like azure pipelines/github changed checkout process in nov 2020.
- script: git fetch origin $(System.PullRequest.targetBranch)
Expand Down Expand Up @@ -109,7 +116,7 @@ steps:
filename: stuart_build
arguments: -c ${{ parameters.build_file }} TOOL_CHAIN_TAG=${{ parameters.tool_chain_tag}} TARGET=${{ parameters.build_target}} -a ${{ parameters.build_arch}} ${{ parameters.build_flags}} ${{ parameters.run_flags }} --FlashOnly
condition: and(and(gt(variables.pkg_count, 0), succeeded()), eq(variables['Run'], true))
timeoutInMinutes: 1
timeoutInMinutes: 2

# Copy the build logs to the artifact staging directory
- task: CopyFiles@2
Expand Down
92 changes: 69 additions & 23 deletions .azurepipelines/templates/pr-gate-build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,25 @@ parameters:
tool_chain_tag: ''
vm_image: ''
arch_list: ''
extra_install_step: []
usePythonVersion: ''
container: ''

# Build step
jobs:

- job: Build_${{ parameters.tool_chain_tag }}

timeoutInMinutes: 120
#Use matrix to speed up the build process
strategy:
matrix:
${{ if eq(parameters.tool_chain_tag, 'GCC5') }}:
TARGET_GCC_ONLY:
Build.Pkgs: 'EmbeddedPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_ARM_ARMPLATFORM:
Build.Pkgs: 'ArmPkg,ArmPlatformPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_MDE_CPU:
Build.Pkgs: 'MdePkg,UefiCpuPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
Expand All @@ -32,55 +42,91 @@ jobs:
Build.Targets: 'RELEASE,NO-TARGET'
TARGET_NETWORK:
Build.Pkgs: 'NetworkPkg,RedfishPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_OTHER:
Build.Pkgs: 'PcAtChipsetPkg,ShellPkg,StandaloneMmPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
Build.Pkgs: 'PcAtChipsetPkg,PrmPkg,ShellPkg,SourceLevelDebugPkg,StandaloneMmPkg,SignedCapsulePkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_FMP_FAT_TEST:
Build.Pkgs: 'FmpDevicePkg,FatPkg,UnitTestFrameworkPkg,DynamicTablesPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_CRYPTO:
TARGET_CRYPTO_DEBUG:
Build.Pkgs: 'CryptoPkg'
Build.Targets: 'DEBUG,NOOPT'
TARGET_CRYPTO_RELEASE:
Build.Pkgs: 'CryptoPkg'
Build.Targets: 'RELEASE,NO-TARGET'
TARGET_FSP:
Build.Pkgs: 'IntelFsp2Pkg,IntelFsp2WrapperPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_SECURITY:
Build.Pkgs: 'SecurityPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_UEFIPAYLOAD:
Build.Pkgs: 'UefiPayloadPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
TARGET_PLATFORMS:
# For Platforms only check code. Leave it to Platform CI
# to build them.
Build.Pkgs: 'ArmVirtPkg,EmulatorPkg,OvmfPkg'
Build.Targets: 'NO-TARGET'
Build.Targets: 'NO-TARGET,NOOPT'

workspace:
clean: all

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

${{ if not(eq(parameters.container, '')) }}:
container: ${{ parameters.container }}

steps:
- template: pr-gate-steps.yml
parameters:
tool_chain_tag: ${{ parameters.tool_chain_tag }}
build_pkgs: $(Build.Pkgs)
build_targets: $(Build.Targets)
build_archs: ${{ parameters.arch_list }}
usePythonVersion: ${{ parameters.usePythonVersion }}
extra_install_step: ${{ parameters.extra_install_step }}

- job: FINISHED
- job: Build_${{ parameters.tool_chain_tag }}_TARGET_CODE_COVERAGE
dependsOn: Build_${{ parameters.tool_chain_tag }}
condition: succeeded()
steps:
- checkout: none
- script: |
echo FINISHED
sleep 10
displayName: FINISHED
workspace:
clean: all

pool:
vmImage: 'windows-2019'

- job: FAILED
dependsOn: Build_${{ parameters.tool_chain_tag }}
condition: failed()
steps:
- checkout: none
- script: |
echo FAILED
sleep 10
displayName: FAILED
- checkout: self
clean: true
fetchDepth: 1
submodules: true

- task: DownloadPipelineArtifact@2
displayName: 'Download Build Artifacts'
inputs:
buildType: 'current'
targetPath: '$(Build.ArtifactStagingDirectory)'

- powershell: Write-Host "##vso[task.setvariable variable=is_code_coverage]0"
displayName: Give default value for whether CodeCoverage or not

- powershell: if (Test-Path -Path $(Build.ArtifactStagingDirectory)/**/coverage.xml) {Write-Host "##vso[task.setvariable variable=is_code_coverage]1"}
displayName: Check coverage.xml exist or not

- task: CmdLine@2
displayName: Create code coverage report
inputs:
script: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:$(Build.ArtifactStagingDirectory)/**/coverage.xml -targetdir:$(Build.ArtifactStagingDirectory)/Coverage -reporttypes:Cobertura -filefilters:-*Build*;-*UnitTest*;-*Mock*;-*usr*
condition: eq(variables.is_code_coverage, 1)

- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.ArtifactStagingDirectory)/Coverage/Cobertura.xml'
condition: eq(variables.is_code_coverage, 1)

19 changes: 14 additions & 5 deletions .azurepipelines/templates/pr-gate-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,25 @@ parameters:
build_pkgs: ''
build_targets: ''
build_archs: ''
usePythonVersion: ''
extra_install_step: []

steps:
- bash: |
echo "##vso[task.prependpath]${HOME}/.local/bin"
echo "new PATH=${PATH}"
displayName: Set PATH
condition: eq('${{ parameters.tool_chain_tag }}', 'GCC5')

- checkout: self
clean: true
fetchDepth: 1

- task: UsePythonVersion@0
inputs:
versionSpec: '3.8.x'
architecture: 'x64'
versionSpec: ${{ parameters.usePythonVersion }}
architecture: "x64"
condition: ne('${{ parameters.usePythonVersion }}', '')

- script: pip install -r pip-requirements.txt --upgrade
displayName: 'Install/Upgrade pip modules'
Expand All @@ -31,15 +40,14 @@ steps:
echo "##vso[task.setvariable variable=pkgs_to_build]${{ parameters.build_pkgs }}"
echo "##vso[task.setvariable variable=pkg_count]${{ 1 }}"
# Use altername cmocka repo
- bash: git config --global url.https://github.com/neverware-mirrors/cmocka.git.insteadOf https://git.cryptomilk.org/projects/cmocka.git

# Fetch the target branch so that pr_eval can diff them.
# Seems like azure pipelines/github changed checkout process in nov 2020.
- script: git fetch origin $(System.PullRequest.targetBranch)
displayName: fetch target branch
condition: eq(variables['Build.Reason'], 'PullRequest')

- ${{ parameters.extra_install_step }}

# trim the package list if this is a PR
- task: CmdLine@1
displayName: Check if ${{ parameters.build_pkgs }} need testing
Expand Down Expand Up @@ -128,6 +136,7 @@ steps:
TestSuites.xml
**/BUILD_TOOLS_REPORT.html
**/OVERRIDELOG.TXT
coverage.xml
flattenFolders: true
condition: succeededOrFailed()

Expand Down
4 changes: 2 additions & 2 deletions .azurepipelines/templates/spell-check-prereq-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ parameters:
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
versionSpec: '14.x'
#checkLatest: false # Optional
condition: and(gt(variables.pkg_count, 0), succeeded())

- script: npm install -g cspell
- script: npm install -g cspell@5.20.0
displayName: 'Install cspell npm'
condition: and(gt(variables.pkg_count, 0), succeeded())
16 changes: 16 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"image": "ghcr.io/tianocore/containers/fedora-35-dev:latest",
"postCreateCommand": "git config --global --add safe.directory * && pip install --upgrade -r pip-requirements.txt",
"customizations": {
"vscode": {
"extensions": [
"DavidAnson.vscode-markdownlint",
"ms-azuretools.vscode-docker",
"ms-vscode-remote.remote-containers",
"ms-vscode.cpptools",
"walonli.edk2-vscode",
"zachflower.uncrustify"
]
}
}
}
31 changes: 31 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# EditorConfig file: https://EditorConfig.org

root = true

[*]
charset = latin1
end_of_line = crlf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.py]
charset = utf-8
indent_style = space
indent_size = 4

[*.sh]
end_of_line = lf

[.gitattributes]
end_of_line = lf

[.mailmap]
charset = utf-8

[Maintainers.txt]
charset = utf-8

[Makefile,GNUmakefile]
indent_style = tab
Loading

0 comments on commit 59a069a

Please sign in to comment.