From 0626ad0f85a9a2e1c2b3782075fdbd78add8d667 Mon Sep 17 00:00:00 2001 From: "Jayaprakash, N" Date: Thu, 20 Jun 2024 17:17:27 +0530 Subject: [PATCH] edk2-libc : add github actions workflow to build PyUEFI using VS2019 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4788 This commit adds github actions workflow to build python uefi interpreter with visual studio 2019 tool chain. The build-python-uefi-vs.yaml file under .github/workflows implements the build action for building the pyuefi interpreter with VS2019 tool chain. Cc: Rebecca Cran Cc: Michael D Kinney Cc: Jayaprakash N Signed-off-by: Jayaprakash N Reviewed-by: Michael D Kinney --- .github/workflows/build-python-uefi-vs.yaml | 84 +++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/build-python-uefi-vs.yaml diff --git a/.github/workflows/build-python-uefi-vs.yaml b/.github/workflows/build-python-uefi-vs.yaml new file mode 100644 index 0000000..a8393d8 --- /dev/null +++ b/.github/workflows/build-python-uefi-vs.yaml @@ -0,0 +1,84 @@ +# GitHub actions workflow to build python uefi using VS2019 +# +# Copyright (c) 2023-2024, Intel Corporation. All rights reserved. +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +name: Build Python Interpreter for UEFI using VS2019 + +on: [push, pull_request] + +jobs: + build: + runs-on: windows-2019 + env: + NASM_PREFIX: "C:\\Program Files\\NASM\\" + defaults: + run: + shell: cmd + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install NASM + run: choco install nasm + + - name: VSWhere + run: | + "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" + + - name: Setup environment for Visual Studio 2019 Build Tools + run: | + "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" x86 + set + + - name: Clone EDK2 + run: | + git clone https://github.com/tianocore/edk2.git" + cd edk2 + git submodule update --init + + - name: Build EDK2 Base Tools + run: | + cd edk2 + dir + edksetup.bat ForceRebuild + + - name: Run srcprep.py + run: | + echo switching to AppPkg\Applications\Python\Python-3.6.8\ + cd AppPkg\Applications\Python\Python-3.6.8\ + dir + echo run srcprep.py file + python srcprep.py + + - name: Build Python UEFI + run: | + set PACKAGES_PATH=%CD%\edk2;%CD%; + set EDK2_LIBC_PATH=%CD% + cd edk2 + call edksetup.bat + build -t VS2019 -a X64 -b RELEASE -p %EDK2_LIBC_PATH%\AppPkg\AppPkg.dsc -D BUILD_PYTHON368 + + - name: Create Python UEFI package + run: | + set WORKSPACE=%CD%\edk2 + set EDK2_LIBC_PATH=%CD% + dir + call AppPkg\Applications\Python\Python-3.6.8\create_python_pkg.bat VS2019 RELEASE X64 myUEFIPy + + - name: List build artifacts + run: | + dir /S edk2\myUEFIPy + + - name: Upload build output as artifact + uses: actions/upload-artifact@v4 + with: + name: myUEFIPy-build-VS2019-output + path: edk2\myUEFIPy\**\*