gnu-efi/.github/workflows/macos-gcc.yml
Callum Farmer 8f5c321507
Better detect the correct MacOS toolchain
* We need ELF not Mach-O

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2024-07-16 14:49:52 +01:00

122 lines
3.3 KiB
YAML

name: macOS, gcc
on: [push, pull_request]
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
arch: [ia32, x64, aa64, arm]
include:
- arch: ia32
dir: ia32
cross_compile: i686-elf-
toolchain: i686-elf-gcc
- arch: x64
dir: x86_64
cross_compile: x86_64-elf-
toolchain: x86_64-elf-gcc
- arch: aa64
dir: aarch64
cross_compile: aarch64-elf-
toolchain: aarch64-elf-gcc
- arch: arm
dir: arm
cross_compile: arm-none-eabi-
toolchain: arm-none-eabi-gcc
steps:
- name: Install toolchain
run: |
brew install ${{ matrix.toolchain }}
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
run: |
make ARCH=${{ matrix.arch }} CROSS_COMPILE=${{ matrix.cross_compile }}
- name: Generate binary information
run: ${{ matrix.cross_compile }}readelf -a ./${{ matrix.dir }}/apps/ctors_dtors_priority_test.so > ./${{ matrix.dir }}/apps/readelf.txt
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arch }}
path: |
./${{ matrix.dir }}/apps/*
tests:
runs-on: ubuntu-24.04
needs: build
strategy:
matrix:
arch: [ia32, x64, 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 }} -nodefaults -nographic -serial stdio -net none -L . -drive if=pflash,format=raw,unit=0,file=${{ matrix.fw_base }}.fd,readonly=on -drive format=raw,file=fat:rw:image"
./tests/gen_tests.sh ./tests/test_list.txt
./tests/run_tests.sh