1+ name : Test
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ tests :
7+ runs-on : ubuntu-latest
8+
9+ steps :
10+ - name : Checkout
11+ uses : actions/checkout@v4
12+
13+ - name : Set up Rust toolchain
14+ uses : actions-rust-lang/setup-rust-toolchain@v1
15+ with :
16+ target : riscv64gc-unknown-none-elf
17+ toolchain : nightly-2025-03-31
18+
19+ - name : Install cargo-binutils and rust-objcopy
20+ run : |
21+ rustup component add llvm-tools-preview
22+ cargo install cargo-binutils
23+
24+ - name : Prepare for Build
25+ run : |
26+ # Fix breaking update in rust dependency.
27+ cargo fetch
28+ find ~/.cargo/git/checkouts/ -type f -name '*.rs' -exec sed -i 's/#\[unsafe(naked)\]/#[naked]/g' {} +
29+
30+ # Correct incorrect build directory name in build script.
31+ sed -i '/^SBI :=/s#riscv64imac-unknown-none-elf#riscv64gc-unknown-none-elf#' Makefile
32+ sed -i '/^SBI :=/s#riscv64imac-unknown-none-elf#riscv64gc-unknown-none-elf#' scripts/make/build.mk
33+
34+ make clone-rustsbi
35+ sed -i -E '/^\s*#\[repr\(align\(16\)\)\]\s*$/d' rustsbi/prototyper/prototyper/src/sbi/early_trap.rs
36+
37+ - name : Build with Makefile
38+ run : |
39+ make defconfig
40+ make
41+
42+ - name : Set up Python
43+ uses : actions/setup-python@v5
44+ with :
45+ python-version : ' 3.12'
46+
47+ - name : Install dev dependencies
48+ run : |
49+ sudo apt update
50+ sudo apt install -y uuid-dev
51+
52+ - name : Build EDK2
53+ run : sh scripts/test/build_edk2.sh
54+
55+ - name : Generate disk image
56+ run : sh scripts/test/disk.sh
57+
58+ - name : Create EFI System Partition (ESP)
59+ run : sh scripts/test/make_esp.sh
60+
61+ - name : Set up QEMU
62+ run : |
63+ sudo apt update
64+ sudo apt install -y qemu-system-misc
65+
66+ - name : Run QEMU
67+ run : make virtiodisk > qemu.log
68+
69+ - name : Upload QEMU log
70+ uses : actions/upload-artifact@v4
71+ with :
72+ name : log
73+ path : qemu.log
74+
75+ - name : Check QEMU output
76+ run : sh scripts/test/check_hello_test.sh
0 commit comments