-
-
Notifications
You must be signed in to change notification settings - Fork 17
69 lines (58 loc) · 1.86 KB
/
Copy pathtest.yml
File metadata and controls
69 lines (58 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Build and Test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang llvm build-essential qemu-system-x86 mtools iasl
- name: Build PatchworkOS
run: make all DEBUG=1 TESTING=1 QEMU_EXIT_ON_PANIC=1
- name: Inspect kernel ELF
run: |
echo "=== Kernel ELF Program Headers ==="
readelf -l bin/kernel/kernel || true
echo "=== Kernel ELF Section Headers ==="
readelf -S bin/kernel/kernel || true
echo "=== Kernel file size ==="
ls -la bin/kernel/kernel
- name: Verify PatchworkOS.img exists
run: |
if [ ! -f bin/PatchworkOS.img ]; then
echo "Error: bin/PatchworkOS.img not found after build!"
exit 1
fi
- name: Run PatchworkOS with QEMU
id: qemu_test
run: |
setsid make run DEBUG=1 TESTING=1 QEMU_EXIT_ON_PANIC=1 QEMU_NOGRAPHIC=1 &
QEMU_PID=$!
echo "QEMU process started with PID=$QEMU_PID"
echo "QEMU_PID=$QEMU_PID" >> $GITHUB_OUTPUT
echo "Leting QEMU run for a bit..."
sleep 120
if ps -p $QEMU_PID > /dev/null
then
echo "QEMU is still running, indicating no error."
echo "Killing QEMU process (PID: $QEMU_PID)..."
kill $QEMU_PID
if ps -p $QEMU_PID > /dev/null
then
echo "QEMU process (PID=$QEMU_PID) did not terminate, forcing kill."
kill -9 $QEMU_PID
fi
exit 0
else
echo "QEMU process (PID=$QEMU_PID) terminated unexpectedly, assuming kernel panicked."
exit 1
fi