12
12
matrix :
13
13
mode : [debug, release]
14
14
module : [builtin, loadable]
15
+ outputdir : [src, build]
15
16
16
17
steps :
17
18
# Setup
@@ -24,15 +25,34 @@ jobs:
24
25
25
26
# Build
26
27
- run : cp .github/workflows/kernel-${{ matrix.mode }}.config .config
28
+
27
29
- if : matrix.module == 'loadable'
28
30
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
31
+
32
+ - if : matrix.outputdir == 'build'
33
+ run : mkdir build && mv .config build/.config
34
+
35
+ - if : matrix.outputdir == 'src'
36
+ run : make CC=clang-10 LLVM_CONFIG_PATH=llvm-config-10 -j3
37
+ - if : matrix.outputdir == 'build'
38
+ run : make O=build CC=clang-10 LLVM_CONFIG_PATH=llvm-config-10 -j3
30
39
31
40
# Run
32
41
- if : matrix.module == 'builtin'
33
42
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
43
+
44
+ - if : matrix.outputdir == 'build'
45
+ run : sed -i 's:drivers/:build/drivers/:' .github/workflows/qemu-initramfs.desc
46
+
47
+ - if : matrix.outputdir == 'src'
48
+ run : usr/gen_init_cpio .github/workflows/qemu-initramfs.desc > qemu-initramfs.img
49
+ - if : matrix.outputdir == 'build'
50
+ run : build/usr/gen_init_cpio .github/workflows/qemu-initramfs.desc > qemu-initramfs.img
51
+
52
+ - if : matrix.outputdir == 'src'
53
+ run : qemu-system-x86_64 -kernel arch/x86/boot/bzImage -initrd qemu-initramfs.img -cpu Cascadelake-Server -smp 2 -nographic -no-reboot -append "console=ttyS0 ${{ matrix.module == 'builtin' && 'rust_example.my_i32=123321' || '' }}" | tee qemu-stdout.log
54
+ - if : matrix.outputdir == 'build'
55
+ run : qemu-system-x86_64 -kernel build/arch/x86/boot/bzImage -initrd qemu-initramfs.img -cpu Cascadelake-Server -smp 2 -nographic -no-reboot -append "console=ttyS0 ${{ matrix.module == 'builtin' && 'rust_example.my_i32=123321' || '' }}" | tee qemu-stdout.log
36
56
37
57
# Check
38
58
- run : grep -F 'Rust Example (init)' qemu-stdout.log
0 commit comments