Skip to content

Update submodules to 2021511. #237

Update submodules to 2021511.

Update submodules to 2021511. #237

Workflow file for this run

name: Build UEFI Firmware
on:
push:
branches:
- main
pull_request:
branches:
- '*'
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
target: [DEBUG, RELEASE]
arch: [X64, AARCH64]
tools: [VS2022, CLANGPDB]
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
# Set up Python 3.12
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: '3.12'
# Install Python dependencies from pip_requirement_stable.txt
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install -r pip_requirement_stable.txt
# Enable long paths in Git configuration (Windows)
- name: Enable Long Paths
run: git config --system core.longpaths true
# Install required Visual Studio components
- name: Install Visual Studio Components
shell: pwsh
run: |
Write-Host "Checking Visual Studio installation path..."
$vsPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -property installationPath
Write-Host "VS Path: $vsPath"
$vsInstaller = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vs_installer.exe"
Write-Host "Installing Visual Studio components..."
$installResult = & $vsInstaller modify `
--installPath $vsPath `
--add Microsoft.VisualStudio.Component.VC.CoreBuildTools `
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
--add Microsoft.VisualStudio.Component.Windows11SDK.22621 `
--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 `
--add Microsoft.VisualStudio.Component.VC.ASAN `
--add Microsoft.VisualStudio.Component.VC.Llvm.Clang `
--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang `
--quiet --wait
Write-Host "Installation completed with exit code: $LASTEXITCODE"
if ($LASTEXITCODE -ne 0) {
throw "Visual Studio component installation failed with exit code: $LASTEXITCODE"
}
Write-Host "Waiting for VS installer to finalize changes..."
Start-Sleep -Seconds 10
# Check if required Visual Studio components are installed
- name: Find Visual Studio Installation with Required Components
shell: pwsh
run: |
$vsPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -property installationPath
if (-not $vsPath) { throw "Visual Studio is not installed." }
Write-Host "Verifying required build tools are available..."
# Check for VC++ build tools
$vcToolsPath = Join-Path $vsPath "VC\Tools\MSVC"
if (-not (Test-Path $vcToolsPath)) {
throw "VC++ tools directory not found at: $vcToolsPath"
}
Write-Host "✓ VC++ build tools found"
# Check for Windows SDK
$windowsSdkPath = "${env:ProgramFiles(x86)}\Windows Kits\10"
if (-not (Test-Path $windowsSdkPath)) {
throw "Windows SDK not found at: $windowsSdkPath"
}
Write-Host "✓ Windows SDK found"
# Check for ARM64 tools if they exist
$armToolsPath = Join-Path $vcToolsPath "*\bin\Hostx64\arm64"
if (Get-ChildItem $armToolsPath -ErrorAction SilentlyContinue) {
Write-Host "✓ ARM/ARM64 build tools found"
}
# CLANG_BIN trailing slash is required by EDK2.
$CLANG_BIN = Join-Path $vsPath "VC/Tools/Llvm/x64/bin/"
$CLANG_EXE = Join-Path $CLANG_BIN "clang.exe"
if (Test-Path $CLANG_EXE) {
Write-Host "clang.exe found at: $CLANG_EXE"
} else {
throw "clang.exe not found at: $CLANG_EXE"
}
# Write environment variable for EDK2 using step to step Github support.
"CLANG_BIN=$CLANG_BIN" >> $env:GITHUB_OUTPUT
Write-Host "All required Visual Studio build tools are properly installed and accessible."
# Stuart Setup: Initialize the build environment
- name: Stuart Setup
run: stuart_setup -c MsvmPkg/PlatformBuild.py TOOL_CHAIN_TAG=${{matrix.tools}}
# Stuart Update: Update the build environment
- name: Stuart Update
run: stuart_update -c MsvmPkg/PlatformBuild.py TOOL_CHAIN_TAG=${{matrix.tools}}
# Stuart Build: Perform the build using the specified architecture and target
- name: Stuart Build
run: stuart_build -c MsvmPkg/PlatformBuild.py --verbose TOOL_CHAIN_TAG=${{matrix.tools}} TARGET=${{matrix.target}} BUILD_ARCH=${{matrix.arch}}
# Upload the MSVM.fd file, MAP/, and PDB/ directories directly as an artifact
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: ${{matrix.target}}-${{matrix.arch}}-${{matrix.tools}}artifacts
path: |
Build/Msvm${{matrix.arch}}/${{matrix.target}}_${{matrix.tools}}/FV/MSVM.fd
Build/Msvm${{matrix.arch}}/${{matrix.target}}_${{matrix.tools}}/MAP/
Build/Msvm${{matrix.arch}}/${{matrix.target}}_${{matrix.tools}}/PDB/