-
Notifications
You must be signed in to change notification settings - Fork 2
157 lines (133 loc) · 5.54 KB
/
workflow.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Build
on: [push, pull_request]
jobs:
build-x86_32:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install ansifilter nasm gcc-multilib g++-multilib xorriso grub-common mtools qemu-system-x86 llvm-dev libclang-dev clang python3 pkg-config flex bison xxd
- name: compile
run: |
cd $GITHUB_WORKSPACE
make alldefconfig MAKE_ARCH=x86
make tests MAKE_ARCH=x86
make MAKE_ARCH=x86 CFLAGS="-m32 -march=i386" LDFLAGS="-m elf_i386" CXXFLAGS="-m32 -march=i386" LDFLAGS="-m elf_i386"
make bootimg-x86-32 MAKE_ARCH=x86
- name: run
run: |
cd $GITHUB_WORKSPACE
timeout 30 qemu-system-x86_64 -cdrom vix.iso -nographic | ansifilter | tee log.txt || true
- name: upload files
uses: actions/upload-artifact@v3
with:
name: ci-run-x86_32
path: ${{runner.workspace}}/vix/vix.iso
- name: check tests
run: |
cd $GITHUB_WORKSPACE
nm --format=bsd -n kernel/kernel.o | python3 tools/testparser.py log.txt >> $GITHUB_STEP_SUMMARY
nm --format=bsd -n kernel/kernel.o | python3 tools/testparser.py log.txt -f
build-x86_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install ansifilter qemu-system-x86 ovmf seabios llvm-dev libclang-dev clang python3 pkg-config flex bison git nasm gzip gawk mtools xxd
- name: build limine
run: |
cd $GITHUB_WORKSPACE/../
wget https://github.com/limine-bootloader/limine/releases/download/v7.4.0/limine-7.4.0.tar.gz
tar -xf limine-7.4.0.tar.gz && mv limine-7.4.0/ limine/
cd limine
./bootstrap
./configure --enable-uefi-x86-64 --enable-bios
make -j $(nproc)
sudo make install
- name: compile
run: |
cd $GITHUB_WORKSPACE
make alldefconfig MAKE_ARCH=x86
make tests MAKE_ARCH=x86
sed -i 's/CONFIG_ENABLE_KERNEL_32=y/# CONFIG_ENABLE_KERNEL_32=y\nCONFIG_ENABLE_KERNEL_64=y/g' kernel/.config
make MAKE_ARCH=x86
make bootimg-x86-64 MAKE_ARCH=x86
- name: run
run: |
cd $GITHUB_WORKSPACE
timeout 30 qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -nographic -serial mon:stdio -hda vix_uefi.img | ansifilter | tee log.txt || true
- name: upload files
uses: actions/upload-artifact@v3
with:
name: ci-run-x86_64
path: ${{runner.workspace}}/vix/vix_uefi.img
- name: check tests
run: |
cd $GITHUB_WORKSPACE
nm --format=bsd -n kernel/kernel.o | python3 tools/testparser.py log.txt >> $GITHUB_STEP_SUMMARY
nm --format=bsd -n kernel/kernel.o | python3 tools/testparser.py log.txt -f
build-aarch64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install ansifilter qemu-system-arm qemu-efi-aarch64 seabios llvm-dev libclang-dev clang python3 pkg-config flex bison gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu git nasm gzip gawk mtools xxd
- name: build limine
run: |
cd $GITHUB_WORKSPACE/../
wget https://github.com/limine-bootloader/limine/releases/download/v7.4.0/limine-7.4.0.tar.gz
tar -xf limine-7.4.0.tar.gz && mv limine-7.4.0/ limine/
cd limine
./bootstrap
CROSS_TOOLCHAIN=aarch64-linux-gnu ./configure --enable-uefi-aarch64
make -j $(nproc)
sudo make install
- name: compile
run: |
cd $GITHUB_WORKSPACE
make alldefconfig tests all MAKE_ARCH=aarch64 CROSS_COMPILE=aarch64-linux-gnu-
make bootimg-aarch64
- name: run
run: |
cd $GITHUB_WORKSPACE
timeout 30 qemu-system-aarch64 -m 1024m -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -cpu cortex-a53 -smp 4 -machine virt -device ramfb -device qemu-xhci -device usb-kbd -nographic -serial mon:stdio -hda vix_uefi.img | ansifilter | tee log.txt || true
- name: upload files
uses: actions/upload-artifact@v3
with:
name: ci-run-aarch64
path: ${{runner.workspace}}/vix/vix_uefi.img
- name: check tests
run: |
cd $GITHUB_WORKSPACE
aarch64-linux-gnu-nm --format=bsd -n kernel/kernel.o | python3 tools/testparser.py log.txt >> $GITHUB_STEP_SUMMARY
aarch64-linux-gnu-nm --format=bsd -n kernel/kernel.o | python3 tools/testparser.py log.txt -f
formatting_and_spelling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y codespell python3
- name: count LOC
run: |
cd $GITHUB_WORKSPACE
python3 tools/locchart.py >> $GITHUB_STEP_SUMMARY
- name: codespell
run: cd $GITHUB_WORKSPACE && codespell -q 3 --builtin clear -S ./.git,./kernel/scripts -L useable || true >> $GITHUB_STEP_SUMMARY
- name: clang-format
run: cd $GITHUB_WORKSPACE && python3 tools/clang_check.py >> $GITHUB_STEP_SUMMARY