Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
matrix:
mode: [debug, release]
module: [builtin, loadable]
outputdir: [src, build]

steps:
# Setup
Expand All @@ -24,15 +25,34 @@ jobs:

# Build
- run: cp .github/workflows/kernel-${{ matrix.mode }}.config .config

- if: matrix.module == 'loadable'
run: sed -i -E 's/^(CONFIG_RUST_EXAMPLE=)(y)$/\1m/g' .config
- run: make CC=clang-10 LLVM_CONFIG_PATH=llvm-config-10 -j3

- if: matrix.outputdir == 'build'
run: mkdir build && mv .config build/.config

- if: matrix.outputdir == 'src'
run: make CC=clang-10 LLVM_CONFIG_PATH=llvm-config-10 -j3
- if: matrix.outputdir == 'build'
run: make O=build CC=clang-10 LLVM_CONFIG_PATH=llvm-config-10 -j3

# Run
- if: matrix.module == 'builtin'
run: sed -i '/rust_example/d' .github/workflows/qemu-initramfs.desc
- run: usr/gen_init_cpio .github/workflows/qemu-initramfs.desc > qemu-initramfs.img
- 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

- if: matrix.outputdir == 'build'
run: sed -i 's:drivers/:build/drivers/:' .github/workflows/qemu-initramfs.desc

- if: matrix.outputdir == 'src'
run: usr/gen_init_cpio .github/workflows/qemu-initramfs.desc > qemu-initramfs.img
- if: matrix.outputdir == 'build'
run: build/usr/gen_init_cpio .github/workflows/qemu-initramfs.desc > qemu-initramfs.img

- if: matrix.outputdir == 'src'
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
- if: matrix.outputdir == 'build'
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

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