Skip to content

Commit bdf9862

Browse files
committed
CI: test O= builds too
Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 2874653 commit bdf9862

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ jobs:
1212
matrix:
1313
mode: [debug, release]
1414
module: [builtin, loadable]
15+
outputdir: [src, build]
16+
17+
env:
18+
MAKE_FLAGS: CC=clang-10 LLVM_CONFIG_PATH=llvm-config-10 -j3
19+
QEMU_FLAGS: -initrd qemu-initramfs.img -cpu Cascadelake-Server -smp 2 -nographic -no-reboot
1520

1621
steps:
1722
# Setup
@@ -24,15 +29,34 @@ jobs:
2429

2530
# Build
2631
- run: cp .github/workflows/kernel-${{ matrix.mode }}.config .config
32+
2733
- if: matrix.module == 'loadable'
2834
run: sed -i -E 's/^(CONFIG_RUST_EXAMPLE=)(y)$/\1m/g' .config
29-
- run: make CC=clang-10 LLVM_CONFIG_PATH=llvm-config-10 -j3
35+
36+
- if: matrix.outputdir == 'build'
37+
run: mkdir build && mv .config build/.config
38+
39+
- if: matrix.outputdir == 'src'
40+
run: make ${MAKE_FLAGS}
41+
- if: matrix.outputdir == 'build'
42+
run: make ${MAKE_FLAGS} O=build
3043

3144
# Run
3245
- if: matrix.module == 'builtin'
3346
run: sed -i '/rust_example/d' .github/workflows/qemu-initramfs.desc
34-
- run: usr/gen_init_cpio .github/workflows/qemu-initramfs.desc > qemu-initramfs.img
35-
- run: qemu-system-x86_64 -kernel arch/x86/boot/bzImage -initrd qemu-initramfs.img -cpu Cascadelake-Server -smp 2 -append "console=ttyS0 ${{ matrix.module == 'builtin' && 'rust_example.my_i32=123321' || '' }}" -nographic -no-reboot | tee qemu-stdout.log
47+
48+
- if: matrix.outputdir == 'build'
49+
run: sed -i 's:drivers/:build/drivers/:' .github/workflows/qemu-initramfs.desc
50+
51+
- if: matrix.outputdir == 'src'
52+
run: usr/gen_init_cpio .github/workflows/qemu-initramfs.desc > qemu-initramfs.img
53+
- if: matrix.outputdir == 'build'
54+
run: build/usr/gen_init_cpio .github/workflows/qemu-initramfs.desc > qemu-initramfs.img
55+
56+
- if: matrix.outputdir == 'src'
57+
run: qemu-system-x86_64 ${QEMU_FLAGS} -kernel arch/x86/boot/bzImage -append "console=ttyS0 ${{ matrix.module == 'builtin' && 'rust_example.my_i32=123321' || '' }}" | tee qemu-stdout.log
58+
- if: matrix.outputdir == 'build'
59+
run: qemu-system-x86_64 ${QEMU_FLAGS} -kernel build/arch/x86/boot/bzImage -append "console=ttyS0 ${{ matrix.module == 'builtin' && 'rust_example.my_i32=123321' || '' }}" | tee qemu-stdout.log
3660

3761
# Check
3862
- run: grep -F 'Rust Example (init)' qemu-stdout.log

0 commit comments

Comments
 (0)