Skip to content

Commit

Permalink
Merge pull request #26 from pbatard/Resolve-Conflicts
Browse files Browse the repository at this point in the history
Add build time QEMU/UEFI tests
  • Loading branch information
ncroxon authored May 20, 2024
2 parents 34754d9 + 23c505d commit 7440e5e
Show file tree
Hide file tree
Showing 13 changed files with 519 additions and 41 deletions.
82 changes: 81 additions & 1 deletion .github/workflows/linux-gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,31 @@ jobs:
arch: [ia32, x64, aa64, arm, riscv64, mips64]
include:
- arch: ia32
dir: ia32
gcc: multilib
cross_compile:
- arch: x64
dir: x86_64
gcc: multilib
cross_compile:
- arch: aa64
dir: aarch64
gcc: aarch64-linux-gnu
cross_compile: aarch64-linux-gnu-
- arch: arm
dir: arm
gcc: arm-linux-gnueabihf
cross_compile: arm-linux-gnueabihf-
- arch: riscv64
dir: riscv64
gcc: riscv64-linux-gnu
cross_compile: riscv64-linux-gnu-
- arch: mips64
dir: mips64el
gcc: mips64el-linux-gnuabi64
cross_compile: mips64el-linux-gnuabi64-
# - arch: loongarch64
# dir: loongarch64
# gcc: loongarch64-linux-gnu
# cross_compile: loongarch64-linux-gnu-

Expand All @@ -42,7 +49,80 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Build
run: make ARCH=${{ matrix.arch }} CROSS_COMPILE=${{ matrix.cross_compile }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arch }}
path: ./${{ matrix.dir }}/apps/*.efi

tests:
runs-on: ubuntu-latest
needs: build

strategy:
matrix:
arch: [x64, ia32, aa64, arm]
include:
- arch: x64
pkg: qemu-system-x86
qemu_arch: x86_64
qemu_opts: -M q35
fw_base: OVMF
- arch: ia32
pkg: qemu-system-x86
qemu_arch: i386
qemu_opts: -M pc
fw_base: OVMF
- arch: aa64
pkg: qemu-system-arm
qemu_arch: aarch64
qemu_opts: -M virt -cpu cortex-a57
fw_base: AAVMF
- arch: arm
pkg: qemu-system-arm
qemu_arch: arm
qemu_opts: -M virt -cpu cortex-a15
fw_base: AAVMF

steps:
- name: Set up Linux environment
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install ${{ matrix.pkg }}
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ${{ matrix.arch }}

- name: Download UEFI firmware
run: |
fw_arch=$(echo ${{ matrix.arch }} | 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: Download UEFI Shell
run: |
curl -L -O https://github.com/pbatard/UEFI-Shell/releases/download/23H2/UEFI-Shell-2.2-23H2-RELEASE.iso
mkdir ./image
7z x -o./image *.iso
rm *.iso
- name: Run tests
run: |
export UEFI_ARCH=${{ matrix.arch }}
export UEFI_DIR=./image
export QEMU_CMD="qemu-system-${{ matrix.qemu_arch }} ${{ matrix.qemu_opts }} -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"
./tests/gen_tests.sh ./tests/test_list.txt
./tests/run_tests.sh
69 changes: 67 additions & 2 deletions .github/workflows/linux-mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ name: Linux, MinGW
on: [push, pull_request]

jobs:
MinGW-Build:
build:
runs-on: ubuntu-latest

strategy:
matrix:
arch: [x64, ia32]
include:
- arch: x64
dir: x86_64
pkg: gcc-mingw-w64-x86-64
tuple: x86_64-w64-mingw32-
- arch: ia32
dir: ia32
pkg: gcc-mingw-w64-i686
tuple: i686-w64-mingw32-

Expand All @@ -22,10 +24,73 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Install gcc toolchain
run: sudo apt install ${{ matrix.pkg }}

- name: Build
run: make ARCH=${{ matrix.arch }} CROSS_COMPILE=${{ matrix.tuple }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arch }}
path: ./${{ matrix.dir }}/apps/*.efi

tests:
runs-on: ubuntu-latest
needs: build

strategy:
matrix:
arch: [x64, ia32]
include:
- arch: x64
pkg: qemu-system-x86
qemu_arch: x86_64
qemu_opts: -M q35
fw_base: OVMF
- arch: ia32
pkg: qemu-system-x86
qemu_arch: i386
qemu_opts: -M pc
fw_base: OVMF

steps:
- name: Set up Linux environment
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install ${{ matrix.pkg }}
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ${{ matrix.arch }}

- name: Download UEFI firmware
run: |
fw_arch=$(echo ${{ matrix.arch }} | 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: Download UEFI Shell
run: |
curl -L -O https://github.com/pbatard/UEFI-Shell/releases/download/23H2/UEFI-Shell-2.2-23H2-RELEASE.iso
mkdir ./image
7z x -o./image *.iso
rm *.iso
- name: Run tests
run: |
export UEFI_ARCH=${{ matrix.arch }}
export UEFI_DIR=./image
export QEMU_CMD="qemu-system-${{ matrix.qemu_arch }} ${{ matrix.qemu_opts }} -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"
./tests/gen_tests.sh ./tests/test_list.txt
./tests/run_tests.sh
69 changes: 67 additions & 2 deletions .github/workflows/windows-mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ name: Windows, MinGW
on: [push, pull_request]

jobs:
MinGW-Build:
build:
runs-on: windows-latest

strategy:
matrix:
arch: [x64, ia32]
include:
- arch: x64
dir: x86_64
sys: mingw64
env: x86_64
- arch: ia32
dir: ia32
sys: mingw32
env: i686

Expand All @@ -36,7 +38,70 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Build
run: make

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arch }}
path: ./${{ matrix.dir }}/apps/*.efi

tests:
runs-on: ubuntu-latest
needs: build

strategy:
matrix:
arch: [x64, ia32]
include:
- arch: x64
pkg: qemu-system-x86
qemu_arch: x86_64
qemu_opts: -M q35
fw_base: OVMF
- arch: ia32
pkg: qemu-system-x86
qemu_arch: i386
qemu_opts: -M pc
fw_base: OVMF

steps:
- name: Set up Linux environment
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install ${{ matrix.pkg }}
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ${{ matrix.arch }}

- name: Download UEFI firmware
run: |
fw_arch=$(echo ${{ matrix.arch }} | 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: Download UEFI Shell
run: |
curl -L -O https://github.com/pbatard/UEFI-Shell/releases/download/23H2/UEFI-Shell-2.2-23H2-RELEASE.iso
mkdir ./image
7z x -o./image *.iso
rm *.iso
- name: Run tests
run: |
export UEFI_ARCH=${{ matrix.arch }}
export UEFI_DIR=./image
export QEMU_CMD="qemu-system-${{ matrix.qemu_arch }} ${{ matrix.qemu_opts }} -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"
./tests/gen_tests.sh ./tests/test_list.txt
./tests/run_tests.sh
Loading

0 comments on commit 7440e5e

Please sign in to comment.