Skip to content

Commit

Permalink
Add workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Marcello Sylvester Bauer <[email protected]>
  • Loading branch information
sylv-io authored and PatrickRudolph committed Feb 2, 2021
1 parent 3f90ac3 commit dc1658e
Show file tree
Hide file tree
Showing 4 changed files with 366 additions and 0 deletions.
306 changes: 306 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,306 @@
---

name: Testing

on:
- push
jobs:
EmulatorPkg:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy install \
git python3 python3-distutils-extra build-essential nasm iasl uuid-dev libxext-dev libx11-dev
DEBIAN_FRONTEND=noninteractive sudo apt-get clean
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1337
- name: Checkout
uses: actions/checkout@v2

- name: Update submodules
run: |
git submodule init
git submodule sync --recursive
git submodule update --recursive
- name: Build BaseTools
run: |
make -C BaseTools
- name: Build EmulatorPkg
run: |
source ./edksetup.sh
build -p EmulatorPkg/EmulatorPkg.dsc -t GCC5 -a X64
OvmfPkgIa32X64:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy install \
git python3 python3-distutils-extra build-essential nasm iasl uuid-dev
DEBIAN_FRONTEND=noninteractive sudo apt-get clean
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1337
- name: Checkout
uses: actions/checkout@v2

- name: Update submodules
run: |
git submodule init
git submodule sync --recursive
git submodule update --recursive
- name: Build BaseTools
run: |
make -C BaseTools
- name: Build IA32X64 OvmfPkg
run: |
source ./edksetup.sh
build -DSOURCE_DEBUG_ENABLE=TRUE -DSECURE_BOOT_ENABLE=TRUE -DTPM_ENABLE=TRUE -DTPM_CONFIG_ENABLE=TRUE -DNETWORK_HTTP_BOOT_ENABLE=TRUE -a IA32 -a X64 -t GCC5 -b DEBUG -p OvmfPkg/OvmfPkgIa32X64.dsc
UefiPayloadPkgX64Cb:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy install \
git python3 python3-distutils-extra build-essential nasm iasl uuid-dev qemu-system-x86 xz-utils
DEBIAN_FRONTEND=noninteractive sudo apt-get clean
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1337
- name: Checkout
uses: actions/checkout@v2

- name: Update submodules
run: |
git submodule init
git submodule sync --recursive
git submodule update --recursive
- name: Build BaseTools
run: |
make -C BaseTools
- name: Build X64 UefiPayload
run: |
source ./edksetup.sh
build -D BOOTLOADER=COREBOOT -a IA32 -a X64 -t GCC5 -b DEBUG -p UefiPayloadPkg/UefiPayloadPkg.dsc
- name: Run binary in QEMU
run: |
./Testing/test_UefiPayloadPkgQemu.sh Build/UefiPayloadPkgX64/DEBUG_GCC5/FV/UEFIPAYLOAD.fd
UefiPayloadPkgX64CbTPM:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy install \
git python3 python3-distutils-extra build-essential nasm iasl uuid-dev qemu-system-x86 xz-utils
DEBIAN_FRONTEND=noninteractive sudo apt-get clean
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1337
- name: Checkout
uses: actions/checkout@v2

- name: Update submodules
run: |
git submodule init
git submodule sync --recursive
git submodule update --recursive
- name: Build BaseTools
run: |
make -C BaseTools
- name: Build X64 UefiPayload with TPM
run: |
if [ "$(grep TPM_ENABLE UefiPayloadPkg/UefiPayloadPkg.dsc)" != "" ]; then
source ./edksetup.sh
build -D BOOTLOADER=COREBOOT -D TPM_ENABLE=TRUE -a IA32 -a X64 -t GCC5 -b DEBUG -p UefiPayloadPkg/UefiPayloadPkg.dsc
else
echo "TPM not supported"
fi
- name: Run binary in QEMU
run: |
if [ "$(grep TPM_ENABLE UefiPayloadPkg/UefiPayloadPkg.dsc)" != "" ]; then
./Testing/test_UefiPayloadPkgQemu.sh Build/UefiPayloadPkgX64/DEBUG_GCC5/FV/UEFIPAYLOAD.fd
else
echo "Not running binary"
fi
UefiPayloadPkgX64CbSecureBoot:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy install \
git python3 python3-distutils-extra build-essential nasm iasl uuid-dev qemu-system-x86 xz-utils
DEBIAN_FRONTEND=noninteractive sudo apt-get clean
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1337
- name: Checkout
uses: actions/checkout@v2

- name: Update submodules
run: |
git submodule init
git submodule sync --recursive
git submodule update --recursive
- name: Build BaseTools
run: |
make -C BaseTools
- name: Build X64 UefiPayload with SecureBoot
run: |
if [ "$(grep SECURE_BOOT_ENABLE UefiPayloadPkg/UefiPayloadPkg.dsc)" != "" ]; then
source ./edksetup.sh
build -D BOOTLOADER=COREBOOT -D SECURE_BOOT_ENABLE=TRUE -a IA32 -a X64 -t GCC5 -b DEBUG -p UefiPayloadPkg/UefiPayloadPkg.dsc
else
echo "SECURE_BOOT_ENABLE not supported"
fi
- name: Run binary in QEMU
run: |
if [ "$(grep SECURE_BOOT_ENABLE UefiPayloadPkg/UefiPayloadPkg.dsc)" != "" ]; then
./Testing/test_UefiPayloadPkgQemu.sh Build/UefiPayloadPkgX64/DEBUG_GCC5/FV/UEFIPAYLOAD.fd
else
echo "Not running binary"
fi
UefiPayloadPkgX64CbNetwork:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy install \
git python3 python3-distutils-extra build-essential nasm iasl uuid-dev qemu-system-x86 xz-utils
DEBIAN_FRONTEND=noninteractive sudo apt-get clean
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1337
- name: Checkout
uses: actions/checkout@v2

- name: Update submodules
run: |
git submodule init
git submodule sync --recursive
git submodule update --recursive
- name: Build BaseTools
run: |
make -C BaseTools
- name: Build X64 UefiPayload with Network
run: |
if [ "$(grep NETWORK_ENABLE UefiPayloadPkg/UefiPayloadPkg.dsc)" != "" ]; then
source ./edksetup.sh
build -D BOOTLOADER=COREBOOT -D NETWORK_ENABLE=TRUE -DNETWORK_HTTP_BOOT_ENABLE=FALSE -a IA32 -a X64 -t GCC5 -b DEBUG -p UefiPayloadPkg/UefiPayloadPkg.dsc
else
echo "NETWORK_ENABLE not supported"
fi
- name: Run binary in QEMU
run: |
if [ "$(grep NETWORK_ENABLE UefiPayloadPkg/UefiPayloadPkg.dsc)" != "" ]; then
./Testing/test_UefiPayloadPkgQemu.sh Build/UefiPayloadPkgX64/DEBUG_GCC5/FV/UEFIPAYLOAD.fd
else
echo "Not running binary"
fi
UefiPayloadPkgX64CbRelease:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy install \
git python3 python3-distutils-extra build-essential nasm iasl uuid-dev qemu-system-x86 xz-utils
DEBIAN_FRONTEND=noninteractive sudo apt-get clean
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1337
- name: Checkout
uses: actions/checkout@v2

- name: Update submodules
run: |
git submodule init
git submodule sync --recursive
git submodule update --recursive
- name: Build BaseTools
run: |
make -C BaseTools
- name: Build X64 UefiPayload in Release mode
run: |
source ./edksetup.sh
build -D BOOTLOADER=COREBOOT -a IA32 -a X64 -t GCC5 -b RELEASE -p UefiPayloadPkg/UefiPayloadPkg.dsc
- name: Run binary in QEMU
run: |
./Testing/test_UefiPayloadPkgQemu.sh Build/UefiPayloadPkgX64/RELEASE_GCC5/FV/UEFIPAYLOAD.fd
UefiPayloadPkgX64Sbl:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy install \
git python3 python3-distutils-extra build-essential nasm iasl uuid-dev qemu-system-x86 xz-utils
DEBIAN_FRONTEND=noninteractive sudo apt-get clean
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1337
- name: Checkout
uses: actions/checkout@v2

- name: Update submodules
run: |
git submodule init
git submodule sync --recursive
git submodule update --recursive
- name: Build BaseTools
run: |
make -C BaseTools
- name: Build X64 UefiPayload
run: |
source ./edksetup.sh
build -D BOOTLOADER=SBL -a IA32 -a X64 -t GCC5 -b DEBUG -p UefiPayloadPkg/UefiPayloadPkg.dsc
- name: Run binary in QEMU
run: |
./Testing/test_UefiPayloadPkgQemu.sh Build/UefiPayloadPkgX64/DEBUG_GCC5/FV/UEFIPAYLOAD.fd
Checks:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy install \
git python3 python3-distutils-extra build-essential nasm iasl uuid-dev xz-utils
DEBIAN_FRONTEND=noninteractive sudo apt-get clean
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1337
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: CheckPatch
run: |
python3 ./BaseTools/Scripts/PatchCheck.py -$(git log HEAD...$(git rev-parse origin/master) --oneline|wc -l)
Binary file added Testing/cbfstool
Binary file not shown.
Binary file added Testing/coreboot.rom.xz
Binary file not shown.
60 changes: 60 additions & 0 deletions Testing/test_UefiPayloadPkgQemu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash

SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
TMPPATH="/tmp/coreboot.rom"

QEMUARGS=
QEMUARGS+="-M q35 "
QEMUARGS+="-m 1024 "
QEMUARGS+="-bios ${TMPPATH} "
QEMUARGS+="-smp $(nproc) "
QEMUARGS+="-display none "

QEMU=qemu-system-x86_64
CBFSTOOL="${SCRIPTPATH}/cbfstool"
XZ=xz

KEYWORDS=
KEYWORDS+="ASSERT "
KEYWORDS+="ASSERT_EFI_ERROR "

${XZ} -k -d "${SCRIPTPATH}/coreboot.rom.xz" -c > ${TMPPATH}
${CBFSTOOL} ${TMPPATH} add-payload -f $1 -n "fallback/payload" -c LZMA
${QEMU} ${QEMUARGS} -serial stdio > /tmp/qemu.log &
pid=$!
i=0
while [ /bin/true ]; do
if [ "$(grep '\[Bds\]Booting\sUEFI\sShell' /tmp/qemu.log)" != "" ]; then
break
fi
if [ "$(grep 'UEFI\sInteractive\sShell\sv' /tmp/qemu.log)" != "" ]; then
break
fi
for k in ${KEYWORDS}; do
if [ "$(grep ${k} /tmp/qemu.log)" != "" ]; then
i=10000
break
fi
done
i=$((i+1))
if [ ${i} -gt 60 ]; then
break
fi
sleep 1
echo "sleeping...."
done
kill -9 ${pid}
for k in ${KEYWORDS}; do
if [ "$(grep ${k} /tmp/qemu.log)" != "" ]; then
echo "Found bad string ${k}"
cat /tmp/qemu.log
printf "\n\nErrors found:\n"
grep ${k} /tmp/qemu.log
rm /tmp/qemu.log
exit 1
fi
done
cat /tmp/qemu.log
printf "\n\nNo errors found\n"
rm /tmp/qemu.log
exit 0

0 comments on commit dc1658e

Please sign in to comment.