Skip to content

Use a single more maintainable file for the test data #18

Use a single more maintainable file for the test data

Use a single more maintainable file for the test data #18

Workflow file for this run

name: Linux (gcc with EDK2)
on:
workflow_dispatch:
branches: [main]
push:
branches: [main]
pull_request:
branches: [main]
env:
BUILD_TYPE: RELEASE
COMPILER: GCC5
GCC5_ARM_PREFIX: arm-linux-gnueabi-
GCC5_AARCH64_PREFIX: aarch64-linux-gnu-
GCC5_RISCV64_PREFIX: riscv64-linux-gnu-
jobs:
Linux-EDK2-Build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- TARGET_TYPE: x64
TARGET_ARCH: X64
TARGET_PKGS: python3-distutils nasm uuid-dev qemu-system-x86
QEMU_ARCH: x86_64
QEMU_OPTS: -M q35
FW_BASE: OVMF
- TARGET_TYPE: ia32
TARGET_ARCH: IA32
TARGET_PKGS: gcc-multilib python3-distutils nasm uuid-dev qemu-system-x86
QEMU_ARCH: i386
QEMU_OPTS: -M pc
FW_BASE: OVMF
- TARGET_TYPE: aa64
TARGET_ARCH: AARCH64
TARGET_PKGS: gcc-aarch64-linux-gnu python3-distutils uuid-dev qemu-system-arm
QEMU_ARCH: aarch64
QEMU_OPTS: -M virt -cpu cortex-a57
FW_BASE: AAVMF
- TARGET_TYPE: arm
TARGET_ARCH: ARM
TARGET_PKGS: gcc-arm-linux-gnueabi python3-distutils uuid-dev qemu-system-arm
QEMU_ARCH: arm
QEMU_OPTS: -M virt -cpu cortex-a15
FW_BASE: AAVMF
- TARGET_TYPE: riscv64
TARGET_ARCH: RISCV64
TARGET_PKGS: gcc-riscv64-linux-gnu python3-distutils uuid-dev qemu-system-misc
QEMU_ARCH: riscv64
QEMU_OPTS: -M virt -cpu sifive-u54
FW_BASE: QEMU_EFI
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set version
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
id: set_version
run: echo "version=$(git describe --tags)" >> $GITHUB_OUTPUT
- name: Create version.h file
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
git update-index --skip-worktree version.h
echo '#define VERSION_STRING L"${{steps.set_version.outputs.version}}"' > version.h
- name: Set up Linux environment
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install ${{ matrix.TARGET_PKGS }}
- name: Set up EDK2
run: |
git clone --recursive https://github.com/tianocore/edk2.git
make -C edk2/BaseTools
- name: Build UEFI bootloader
run: |
export WORKSPACE=$PWD
export PACKAGES_PATH=$WORKSPACE:$WORKSPACE/edk2
source edk2/edksetup.sh
build -a ${{ matrix.TARGET_ARCH }} -b ${{ env.BUILD_TYPE }} -t ${{ env.COMPILER }} -p Md5SumPkg.dsc
mv Build/${{ env.BUILD_TYPE }}_${{ env.COMPILER }}/${{ matrix.TARGET_ARCH }}/Md5Sum.efi boot${{ matrix.TARGET_TYPE }}.efi
- name: Display SHA-256
run: sha256sum *.efi
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: uefi-md5sum
path: ./*.efi
- name: Download UEFI firmware
run: |
FW_ARCH=$(echo ${{ matrix.TARGET_TYPE }} | tr a-z A-Z)
FW_ZIP=${{ matrix.FW_BASE }}-${FW_ARCH}.zip
curl -O https://efi.akeo.ie/${{ matrix.FW_BASE }}/${FW_ZIP}
7z x ${FW_ZIP}
rm ${FW_ZIP}
- name: Build image directory
run: |
mkdir -p image/efi/boot
cp boot${{ matrix.TARGET_TYPE }}.efi image/efi/boot
- name: Run tests
# Qemu doesn't support -smbios for RISCV64, so we don't run the tests there
if: matrix.TARGET_TYPE != 'riscv64'
run: |
export QEMU_CMD="qemu-system-${{ matrix.QEMU_ARCH }} ${{ matrix.QEMU_OPTS }} -smbios type=0,vendor=\"GitHub Actions Test\",version=\"v1.0\" -L . -drive if=pflash,format=raw,unit=0,file=${{ matrix.FW_BASE }}.fd,readonly=on -drive format=raw,file=fat:rw:image -nodefaults -nographic -serial stdio -net none"
./gen_tests.sh
./run_tests.sh