From 0e0fe0fd7988123f5a90a2d4f613dbe109ea36ed Mon Sep 17 00:00:00 2001 From: Dongyan Qian Date: Wed, 11 Dec 2024 18:31:45 +0800 Subject: [PATCH] edk2-libc: add github workflow to build app efi with GCC Signed-off-by: Dongyan Qian --- .github/workflows/build-app-uefi-gcc.yaml | 70 +++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/build-app-uefi-gcc.yaml diff --git a/.github/workflows/build-app-uefi-gcc.yaml b/.github/workflows/build-app-uefi-gcc.yaml new file mode 100644 index 0000000..8b4fc64 --- /dev/null +++ b/.github/workflows/build-app-uefi-gcc.yaml @@ -0,0 +1,70 @@ +# GitHub actions workflow to build AppPkg EFI using gcc +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +name: Build Project for AppPkg EFI with GCC + +on: [push, pull_request] + +env: + BUILD_TYPE: RELEASE + COMPILER: GCC5 + GCC5_AARCH64_PREFIX: aarch64-linux-gnu- + GCC5_LOONGARCH64_PREFIX: loongarch64-unknown-linux-gnu- + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + arch: [X64, AARCH64, LOONGARCH64] + include: + - arch: X64 + short: x64 + pkgs: null + - arch: AARCH64 + short: aa64 + pkgs: gcc-aarch64-linux-gnu + - arch: LOONGARCH64 + short: loongarch64 + pkgs: null + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential uuid-dev iasl git nasm python3-distutils + if [ -n "${{ matrix.pkgs }}" ]; then + sudo apt-get install -y ${{ matrix.pkgs }} + else + echo "No additional packages for ${{ matrix.arch }}" + fi + + - name: Download and Install loongarch64 toolchain + if: matrix.arch == 'loongarch64' + run: | + curl -L -O https://github.com/loongson/build-tools/releases/download/2024.11.01/x86_64-cross-tools-loongarch64-binutils_2.43.1-gcc_14.2.0-glibc_2.40.tar.xz + tar -xJf x86_64-cross-tools-loongarch64-binutils_2.43.1-gcc_14.2.0-glibc_2.40.tar.xz + echo "$PWD/cross-tools/bin" >> "$GITHUB_PATH" + + - name: Build EDK2 Base Tools + run: | + git clone --recursive https://github.com/tianocore/edk2.git + cd edk2 + git submodule update --init --recursive + . edksetup.sh + make -C BaseTools + + - name: Build AppPkg EFI + run: | + export PACKAGES_PATH=`pwd`/edk2:`pwd` + export EDK2_LIBC_PATH=`pwd` + cd edk2 + source edksetup.sh + build -a ${{ matrix.arch }} -b ${{ env.BUILD_TYPE }} -t ${{ env.COMPILER }} -p $EDK2_LIBC_PATH/StdLib/StdLib.dsc + build -a ${{ matrix.arch }} -b ${{ env.BUILD_TYPE }} -t ${{ env.COMPILER }} -p $EDK2_LIBC_PATH/AppPkg/AppPkg.dsc