Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EDK2 test build #20

Merged
merged 2 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ jobs:
done
shell: bash

- name: Check
run: |
osteffenrh marked this conversation as resolved.
Show resolved Hide resolved
# Only check the last sub-image in the list (for now)
sub=${SUB_IMAGES##* }
IMG=$(tr '[:upper:]' '[:lower:]' <<< "${REGISTRY}/${REPOSITORY}/${IMAGE_NAME}-${sub}:${short_sha}")
echo "Launching ${IMG}..."
docker run \
--rm \
--volume "${PWD}":/work \
--workdir /work \
"${IMG}" \
"./.github/workflows/test_build_edk2.sh"
shell: bash

- name: Push
if: ${{ github.ref == 'refs/heads/main' }}
run: |
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/test_build_edk2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/sh
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
# Simple smoke-test build of EDK2

set -e
set -x

if [ -d edk2 ]; then
echo "Reusing existing EDK2 source tree."
cd edk2
echo " Cleaning up..."
git fetch --all
git reset --hard origin/master
git clean -xdf
else
echo "Pulling fresh EDK2 source tree."
git clone --depth=1 "https://github.com/tianocore/edk2.git"
cd edk2
fi

# fixups / workarounds:
# removing these files will use gcc from the image and not download it and
# run into the python tar bug.
rm -f BaseTools/Bin/gcc_arm_linux_ext_dep.yaml BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml

python -m pip install --upgrade pip
python -m pip install --upgrade -r pip-requirements.txt

stuart_setup -c .pytool/CISettings.py
stuart_update -c .pytool/CISettings.py

python BaseTools/Edk2ToolsBuild.py -t GCC5

build_step() {
build=$1
arch=$2
opts="TOOL_CHAIN_TAG=GCC5"
echo "-----------------------------------------------------------------------"
echo "Building ${build} for ${arch}"
echo "-----------------------------------------------------------------------"
stuart_setup $opts -c "${build}" -a "${arch}"
stuart_update $opts -c "${build}" -a "${arch}"
stuart_build $opts -c "${build}" -a "${arch}"
}

build_step "OvmfPkg/PlatformCI/PlatformBuild.py" "X64"
build_step "ArmVirtPkg/PlatformCI/PlatformBuild.py" "AARCH64"
build_step "ArmVirtPkg/PlatformCI/PlatformBuild.py" "ARM"