-
Notifications
You must be signed in to change notification settings - Fork 86
190 lines (182 loc) · 6.88 KB
/
ci.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: CI
on:
pull_request:
merge_group:
env:
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings
jobs:
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: mkroening/rust-toolchain-toml@main
- run: rustup component add clippy
- name: Install NASM
run: |
sudo apt-get update
sudo apt-get install nasm
- name: Clippy
run: |
cargo clippy --all-targets
cargo clippy -Zbuild-std=std,panic_abort --target=x86_64-unknown-hermit --all-targets
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mkroening/rust-toolchain-toml@main
- run: rustup component add rustfmt
- name: Format
run: cargo fmt -- --check
check-docs:
name: Check docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install NASM
run: |
sudo apt-get update
sudo apt-get install nasm
- uses: mkroening/rust-toolchain-toml@main
- name: Check docs
run: cargo doc --no-deps --document-private-items
kvm:
name: KVM
runs-on: [self-hosted]
steps:
- name: Install NASM
run: |
sudo apt-get update
sudo apt-get install -y nasm qemu-kvm
- uses: actions/checkout@v4
with:
submodules: true
- uses: mkroening/rust-toolchain-toml@main
- name: Download loader
uses: dsaltares/[email protected]
with:
repo: hermitcore/rusty-loader
file: rusty-loader-x86_64
- name: Build dev profile
run: cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package rusty_demo
- name: Install uhyve
run: cargo +stable install --locked uhyve
- name: Check KVM availability
shell: bash
run: |
lscpu
kvm-ok
- name: Test debug version (Uhyve)
run: uhyve --verbose -c 1 target/x86_64-unknown-hermit/debug/rusty_demo
env:
RUST_LOG: debug
- name: Test debug profile (Qemu)
run: |
qemu-system-x86_64 -display none -smp 1 -m 128M -serial stdio \
-enable-kvm -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand \
-kernel rusty-loader-x86_64 \
-initrd target/x86_64-unknown-hermit/debug/rusty_demo
- name: Build release profile
run: cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package rusty_demo --release
- name: Test release version (Uhyve)
run: uhyve --verbose -c 1 target/x86_64-unknown-hermit/release/rusty_demo
env:
RUST_LOG: debug
- name: Test release profile (Qemu)
run: |
qemu-system-x86_64 -display none -smp 1 -m 128M -serial stdio \
-enable-kvm -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand \
-kernel rusty-loader-x86_64 \
-initrd target/x86_64-unknown-hermit/release/rusty_demo
run-aarch64:
name: QEMU (aarch64)
runs-on: ubuntu-latest
steps:
- name: Install CURL, QEMU
run: |
sudo apt-get update
sudo apt-get install qemu-system-aarch64 curl
- uses: actions/checkout@v4
with:
submodules: true
- name: Download loader
uses: dsaltares/[email protected]
with:
repo: hermitcore/rusty-loader
file: rusty-loader-aarch64
- uses: mkroening/rust-toolchain-toml@main
- uses: Swatinem/rust-cache@v2
- name: Build dev profile
run: cargo build -Zbuild-std=std,panic_abort --target aarch64-unknown-hermit --package rusty_demo
- name: Test dev profile
run: |
qemu-system-aarch64 -semihosting \
-kernel rusty-loader-aarch64 -machine virt,gic-version=max \
-m 512M -cpu max -smp 1 -display none -serial stdio -kernel rusty-loader-aarch64 \
-device guest-loader,addr=0x48000000,initrd=target/aarch64-unknown-hermit/debug/rusty_demo
- name: Build release profile
run: cargo build -Zbuild-std=std,panic_abort --target aarch64-unknown-hermit --package rusty_demo --release
- name: Test release profile
run: |
qemu-system-aarch64 -semihosting \
-kernel rusty-loader-aarch64 -machine virt,gic-version=max \
-m 512M -cpu max -smp 1 -display none -serial stdio -kernel rusty-loader-aarch64 \
-device guest-loader,addr=0x48000000,initrd=target/aarch64-unknown-hermit/release/rusty_demo
qemu-x86_64:
name: QEMU (x86_64)
runs-on: ubuntu-latest
steps:
- name: Install CURL, QEMU, NASM
run: |
sudo apt-get update
sudo apt-get install qemu-system-x86 nasm curl
- uses: actions/checkout@v4
with:
submodules: true
- name: Download loader
uses: dsaltares/[email protected]
with:
repo: hermitcore/rusty-loader
file: rusty-loader-x86_64
- uses: mkroening/rust-toolchain-toml@main
- uses: Swatinem/rust-cache@v2
- name: Build dev profile
run: cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package rusty_demo
- name: Test dev profile
run: |
qemu-system-x86_64 -display none -smp 1 -m 128M -serial stdio \
-cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand \
-kernel rusty-loader-x86_64 \
-initrd target/x86_64-unknown-hermit/debug/rusty_demo
- name: Build release profile
run:
cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package rusty_demo --release
- name: Test release profile
run: |
qemu-system-x86_64 -display none -smp 1 -m 128M -serial stdio \
-cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand \
-kernel rusty-loader-x86_64 \
-initrd target/x86_64-unknown-hermit/release/rusty_demo
- name: Build httpd with DHCP support
run:
cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package httpd --features rtl8139,ci,dhcpv4
- name: Test httpd with DHCP support
run: |
qemu-system-x86_64 -smp 1 -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr,rdrand \
-device isa-debug-exit,iobase=0xf4,iosize=0x04 -display none -m 128M -serial stdio \
-kernel rusty-loader-x86_64 \
-initrd target/x86_64-unknown-hermit/debug/httpd \
-netdev user,id=u1,hostfwd=tcp::9975-:9975,net=192.168.76.0/24,dhcpstart=192.168.76.9 \
-device rtl8139,netdev=u1 &
sleep 5
curl http://127.0.0.1:9975/help
sleep 1
- name: Build httpd without DHCP support
run:
cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --package httpd