Skip to content

Commit 485e60d

Browse files
committed
CI: test O= builds too
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 2874653 commit 485e60d

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

.github/workflows/ci.yaml

+24-3
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,31 @@ 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 == 'src'
37+
run: make ${MAKE_FLAGS}
38+
- if: matrix.outputdir == 'build'
39+
run: |
40+
mkdir build
41+
mv .config build/.config
42+
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 == 'src'
49+
run: |
50+
usr/gen_init_cpio .github/workflows/qemu-initramfs.desc > qemu-initramfs.img
51+
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
52+
- if: matrix.outputdir == 'build'
53+
run: |
54+
sed -i 's:drivers/:build/drivers/:' .github/workflows/qemu-initramfs.desc
55+
build/usr/gen_init_cpio .github/workflows/qemu-initramfs.desc > qemu-initramfs.img
56+
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
3657
3758
# Check
3859
- run: grep -F 'Rust Example (init)' qemu-stdout.log

0 commit comments

Comments
 (0)