Skip to content

Commit 4fde625

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

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ jobs:
1212
matrix:
1313
mode: [debug, release]
1414
module: [builtin, loadable]
15+
outputdir: [src, build]
16+
17+
env:
18+
BUILD_DIR: build
19+
MAKE_FLAGS: CC=clang-10 LLVM_CONFIG_PATH=llvm-config-10 -j3
20+
QEMU_INITRAM_DESC: .github/workflows/qemu-initramfs.desc
21+
QEMU_INITRAM_IMG: qemu-initramfs.img
22+
QEMU_STDOUT_LOG: qemu-stdout.log
1523

1624
steps:
1725
# Setup
@@ -26,16 +34,25 @@ jobs:
2634
- run: cp .github/workflows/kernel-${{ matrix.mode }}.config .config
2735
- if: matrix.module == 'loadable'
2836
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
37+
- if: matrix.outputdir == 'src'
38+
run: make ${MAKE_FLAGS}
39+
- if: matrix.outputdir == 'build'
40+
run: |
41+
mkdir ${BUILD_DIR}
42+
mv .config ${BUILD_DIR}/.config
43+
make ${MAKE_FLAGS} O=${BUILD_DIR}
3044
3145
# Run
3246
- if: matrix.module == 'builtin'
33-
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+
run: sed -i '/rust_example/d' ${QEMU_INITRAM_DESC}
48+
- if: matrix.outputdir == 'src'
49+
run: usr/gen_init_cpio ${QEMU_INITRAM_DESC} > ${QEMU_INITRAM_IMG}
50+
- if: matrix.outputdir == 'build'
51+
run: ${BUILD_DIR}/usr/gen_init_cpio ${QEMU_INITRAM_DESC} > ${QEMU_INITRAM_IMG}
52+
- run: qemu-system-x86_64 -kernel arch/x86/boot/bzImage -initrd ${QEMU_INITRAM_IMG} -cpu Cascadelake-Server -smp 2 -append "console=ttyS0 ${{ matrix.module == 'builtin' && 'rust_example.my_i32=123321' || '' }}" -nographic -no-reboot | tee ${QEMU_STDOUT_LOG}
3653

3754
# Check
38-
- run: grep -F 'Rust Example (init)' qemu-stdout.log
39-
- run: "grep 'my_i32: \\+123321' qemu-stdout.log"
55+
- run: grep -F 'Rust Example (init)' ${QEMU_STDOUT_LOG}
56+
- run: "grep 'my_i32: \\+123321' ${QEMU_STDOUT_LOG}
4057
- if: matrix.module == 'loadable'
41-
run: grep -F 'Rust Example (exit)' qemu-stdout.log
58+
run: grep -F 'Rust Example (exit)' ${QEMU_STDOUT_LOG}

0 commit comments

Comments
 (0)