Skip to content

Commit d0ea2b1

Browse files
committed
[ci] Use prebuilt containers to build and test iPXE
Use the prebuilt containers from https://github.com/ipxe/ipxe-builder to build BIOS, SBI, UEFI, and Linux userspace versions of iPXE for all supported CPU architectures, and to run the Linux userspace test suite (via valgrind or qemu as applicable). This reduces the time taken for GitHub CI runs by around 80%, while increasing the build coverage to include RISC-V SBI, RISC-V UEFI, and LoongArch64 UEFI, and increasing the test coverage to include running the Linux userspace test suite on all supported CPU architectures. Signed-off-by: Michael Brown <mcb30@ipxe.org>
1 parent 207c99a commit d0ea2b1

1 file changed

Lines changed: 114 additions & 97 deletions

File tree

.github/workflows/build.yml

Lines changed: 114 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -2,116 +2,133 @@ name: Build
22

33
on: push
44

5+
env:
6+
MAKEFLAGS: "-j4 GITVERSION=${{ github.sha }}"
7+
58
jobs:
69

7-
cache:
8-
name: Cache
9-
runs-on: ubuntu-24.04
10+
bios:
11+
name: BIOS / ${{ matrix.arch }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
arch:
17+
- i386
18+
- x86_64
19+
container:
20+
image: ghcr.io/ipxe/ipxe-builder-${{ matrix.arch }}
21+
env:
22+
bindir: >-
23+
${{ matrix.arch == 'i386' && 'bin' || 'bin-x86_64-pcbios' }}
1024
steps:
11-
- name: Cache permissions
12-
run: |
13-
sudo chown $(id -un) /var/cache/apt/archives
14-
- name: Cache packages
15-
uses: actions/cache@v4
16-
with:
17-
path: /var/cache/apt/archives/*.deb
18-
key: apt-cache-${{ github.run_id }}-${{ github.run_attempt }}
19-
restore-keys: |
20-
apt-cache-
21-
- name: Download packages
25+
26+
- name: Check out code
27+
uses: actions/checkout@v6
28+
29+
- name: Build
30+
working-directory: src
2231
run: |
23-
sudo apt update
24-
sudo apt install -y -d -o Acquire::Retries=50 \
25-
mtools syslinux isolinux genisoimage \
26-
libc6-dev-i386 liblzma-dev valgrind \
27-
gcc-arm-none-eabi gcc-aarch64-linux-gnu
28-
29-
x86:
30-
name: x86
31-
runs-on: ubuntu-24.04
32-
needs: cache
32+
make ${{ env.bindir }}/10ec8139.rom \
33+
${{ env.bindir }}/8086100e.mrom \
34+
${{ env.bindir }}/ipxe.dsk \
35+
${{ env.bindir }}/ipxe.iso \
36+
${{ env.bindir }}/ipxe.pxe \
37+
${{ env.bindir }}/ipxe.usb \
38+
${{ env.bindir }}/undionly.kpxe
39+
40+
sbi:
41+
name: SBI / ${{ matrix.arch }}
42+
runs-on: ubuntu-latest
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
arch:
47+
- riscv32
48+
- riscv64
49+
container:
50+
image: ghcr.io/ipxe/ipxe-builder-${{ matrix.arch }}
51+
env:
52+
bindir: bin-${{ matrix.arch }}
3353
steps:
54+
3455
- name: Check out code
35-
uses: actions/checkout@v4
36-
- name: Cache permissions
37-
run: |
38-
sudo chown $(id -un) /var/cache/apt/archives
39-
- name: Cache packages
40-
uses: actions/cache/restore@v4
41-
with:
42-
path: /var/cache/apt/archives/*.deb
43-
key: apt-cache-${{ github.run_id }}-${{ github.run_attempt }}
44-
- name: Install packages
45-
run: |
46-
sudo dpkg --add-architecture i386
47-
sudo apt update
48-
sudo apt install -y -o Acquire::Retries=50 \
49-
mtools syslinux isolinux genisoimage \
50-
libc6-dev-i386 liblzma-dev valgrind \
51-
libgcc-s1:i386 libc6-dbg:i386
52-
- name: Build (BIOS)
53-
run: |
54-
make -j 4 -C src
55-
- name: Build (Everything)
56-
run: |
57-
make -j 4 -C src everything
58-
- name: Test
56+
uses: actions/checkout@v6
57+
58+
- name: Build
59+
working-directory: src
5960
run: |
60-
valgrind ./src/bin-i386-linux/tests.linux
61-
valgrind ./src/bin-x86_64-linux/tests.linux
61+
make ${{ env.bindir }}/ipxe.pf32 \
62+
${{ env.bindir }}/ipxe.lkrn \
63+
${{ env.bindir }}/ipxe.sbi
6264
63-
arm32:
64-
name: ARM32
65-
runs-on: ubuntu-24.04
66-
needs: cache
65+
uefi:
66+
name: UEFI / ${{ matrix.arch }}
67+
runs-on: ubuntu-latest
68+
strategy:
69+
fail-fast: false
70+
matrix:
71+
arch:
72+
- arm32
73+
- arm64
74+
- i386
75+
- loong64
76+
- riscv32
77+
- riscv64
78+
- x86_64
79+
container:
80+
image: ghcr.io/ipxe/ipxe-builder-${{ matrix.arch }}
81+
env:
82+
bindir: bin-${{ matrix.arch }}-efi
6783
steps:
84+
6885
- name: Check out code
69-
uses: actions/checkout@v4
70-
- name: Cache permissions
71-
run: |
72-
sudo chown $(id -un) /var/cache/apt/archives
73-
- name: Cache packages
74-
uses: actions/cache/restore@v4
75-
with:
76-
path: /var/cache/apt/archives/*.deb
77-
key: apt-cache-${{ github.run_id }}-${{ github.run_attempt }}
78-
- name: Install packages
79-
run: |
80-
sudo apt update
81-
sudo apt install -y -o Acquire::Retries=50 \
82-
mtools syslinux isolinux genisoimage \
83-
gcc-arm-none-eabi
86+
uses: actions/checkout@v6
87+
8488
- name: Build
89+
working-directory: src
8590
run: |
86-
make -j 4 -C src CROSS=arm-none-eabi- \
87-
bin-arm32-efi/intel.efi \
88-
bin-arm32-efi/intel.usb \
89-
bin-arm32-efi/intel.iso
90-
91-
arm64:
92-
name: ARM64
93-
runs-on: ubuntu-24.04
94-
needs: cache
91+
make ${{ env.bindir }}/ipxe.efi \
92+
${{ env.bindir }}/ipxe.iso \
93+
${{ env.bindir }}/ipxe.usb \
94+
${{ env.bindir }}/snponly.efi
95+
96+
tests:
97+
name: Tests / ${{ matrix.arch }}
98+
runs-on: ubuntu-latest
99+
strategy:
100+
fail-fast: false
101+
matrix:
102+
include:
103+
- arch: arm32
104+
exec: qemu-arm-static
105+
- arch: arm64
106+
exec: qemu-aarch64-static
107+
- arch: i386
108+
exec: valgrind
109+
- arch: loong64
110+
exec: qemu-loongarch64-static
111+
- arch: riscv32
112+
exec: qemu-riscv32-static
113+
- arch: riscv64
114+
exec: qemu-riscv64-static
115+
- arch: x86_64
116+
exec: valgrind
117+
container:
118+
image: ghcr.io/ipxe/ipxe-builder-${{ matrix.arch }}
119+
env:
120+
bindir: bin-${{ matrix.arch }}-linux
95121
steps:
122+
96123
- name: Check out code
97-
uses: actions/checkout@v4
98-
- name: Cache permissions
99-
run: |
100-
sudo chown $(id -un) /var/cache/apt/archives
101-
- name: Cache packages
102-
uses: actions/cache/restore@v4
103-
with:
104-
path: /var/cache/apt/archives/*.deb
105-
key: apt-cache-${{ github.run_id }}-${{ github.run_attempt }}
106-
- name: Install packages
107-
run: |
108-
sudo apt update
109-
sudo apt install -y -o Acquire::Retries=50 \
110-
mtools syslinux isolinux genisoimage \
111-
gcc-aarch64-linux-gnu
124+
uses: actions/checkout@v6
125+
112126
- name: Build
127+
working-directory: src
128+
run: |
129+
make ${{ env.bindir }}/tests.linux
130+
131+
- name: Test
132+
working-directory: src
113133
run: |
114-
make -j 4 -C src CROSS=aarch64-linux-gnu- \
115-
bin-arm64-efi/ipxe.efi \
116-
bin-arm64-efi/ipxe.usb \
117-
bin-arm64-efi/ipxe.iso
134+
${{ matrix.exec }} ${{ env.bindir }}/tests.linux

0 commit comments

Comments
 (0)