21
21
targets : x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat, loongarch64-unknown-none-softfloat
22
22
- uses : Swatinem/rust-cache@v2
23
23
with :
24
+ shared-key : cargo-bin-cache
24
25
cache-targets : false
25
26
- name : Check rust version
26
27
run : rustc --version --verbose
@@ -37,11 +38,10 @@ jobs:
37
38
run : make clippy ARCH=${{ matrix.arch }}
38
39
39
40
build :
40
- runs-on : ${{ matrix.os }}
41
+ runs-on : ubuntu-latest
41
42
strategy :
42
43
fail-fast : false
43
44
matrix :
44
- os : [ubuntu-latest]
45
45
arch : [x86_64, riscv64, aarch64, loongarch64]
46
46
rust-toolchain : [nightly, nightly-2025-05-20]
47
47
env :
55
55
targets : x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat, loongarch64-unknown-none-softfloat
56
56
- uses : Swatinem/rust-cache@v2
57
57
with :
58
+ shared-key : cargo-bin-cache
58
59
cache-targets : false
59
- - run : cargo install cargo-binutils
60
60
- name : Build helloworld
61
61
continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
62
62
run : make ARCH=${{ matrix.arch }} A=examples/helloworld
70
70
continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
71
71
run : make ARCH=${{ matrix.arch }} A=examples/shell
72
72
73
- - uses : ./.github/workflows/actions/ setup-musl
73
+ - uses : arceos-org/ setup-musl@v1
74
74
with :
75
75
arch : ${{ matrix.arch }}
76
76
- name : Build helloworld-c
@@ -84,12 +84,13 @@ jobs:
84
84
run : make ARCH=${{ matrix.arch }} A=examples/httpserver-c
85
85
86
86
build-for-other-platforms :
87
- runs-on : ${{ matrix.os }}
87
+ runs-on : ubuntu-latest
88
88
strategy :
89
89
fail-fast : false
90
90
matrix :
91
- os : [ubuntu-latest]
92
91
rust-toolchain : [nightly, nightly-2025-05-20]
92
+ env :
93
+ RUSTUP_TOOLCHAIN : ${{ matrix.rust-toolchain }}
93
94
steps :
94
95
- uses : actions/checkout@v4
95
96
- uses : dtolnay/rust-toolchain@stable
@@ -99,50 +100,179 @@ jobs:
99
100
targets : x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat, loongarch64-unknown-none-softfloat
100
101
- uses : Swatinem/rust-cache@v2
101
102
with :
103
+ shared-key : cargo-bin-cache
102
104
cache-targets : false
103
- - run : cargo install cargo-binutils
105
+
106
+ # Test various config files
104
107
- name : Build helloworld for x86_64-pc-oslab
105
108
continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
106
- run : make PLATFORM= x86_64-pc-oslab A=examples/helloworld
109
+ run : make PLAT_CONFIG=$(pwd)/configs/custom/ x86_64-pc-oslab.toml A=examples/helloworld
107
110
- name : Build httpclient for x86_64-pc-oslab
108
111
continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
109
- run : make PLATFORM= x86_64-pc-oslab A=examples/httpclient FEATURES=page-alloc-4g,driver-ixgbe
112
+ run : make PLAT_CONFIG=$(pwd)/configs/custom/ x86_64-pc-oslab.toml A=examples/httpclient FEATURES=page-alloc-4g,driver-ixgbe
110
113
- name : Build httpserver for x86_64-pc-oslab
111
114
continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
112
- run : make PLATFORM= x86_64-pc-oslab A=examples/httpserver FEATURES=page-alloc-4g,driver-ixgbe
115
+ run : make PLAT_CONFIG=$(pwd)/configs/custom/ x86_64-pc-oslab.toml A=examples/httpserver FEATURES=page-alloc-4g,driver-ixgbe
113
116
- name : Build shell for x86_64-pc-oslab
114
117
continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
115
- run : make PLATFORM= x86_64-pc-oslab A=examples/shell FEATURES=page-alloc-4g,driver-ramdisk
118
+ run : make PLAT_CONFIG=$(pwd)/configs/custom/ x86_64-pc-oslab.toml A=examples/shell FEATURES=page-alloc-4g,driver-ramdisk
116
119
117
- - run : make PLATFORM=aarch64-raspi4 defconfig
120
+ # Test app `helloworld-myplat` for various platforms
121
+ - name : Build helloworld-myplat for x86-pc
122
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
123
+ run : |
124
+ make ARCH=x86_64 defconfig
125
+ make ARCH=x86_64 A=examples/helloworld-myplat SMP=4 APP_FEATURES=x86-pc
126
+ make MYPLAT=axplat-x86-pc A=examples/helloworld-myplat SMP=4 APP_FEATURES=x86-pc
127
+ - name : Build helloworld-myplat for aarch64-qemu-virt
128
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
129
+ run : |
130
+ make ARCH=aarch64 defconfig
131
+ make ARCH=aarch64 A=examples/helloworld-myplat SMP=4 APP_FEATURES=aarch64-qemu-virt
132
+ make MYPLAT=axplat-aarch64-qemu-virt A=examples/helloworld-myplat SMP=4 APP_FEATURES=aarch64-qemu-virt
133
+ - name : Build helloworld-myplat for aarch64-raspi4
134
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
135
+ run : |
136
+ make MYPLAT=axplat-aarch64-raspi defconfig
137
+ make MYPLAT=axplat-aarch64-raspi A=examples/helloworld-myplat APP_FEATURES=aarch64-raspi4
138
+ - name : Build helloworld-myplat for aarch64-bsta1000b
139
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
140
+ run : |
141
+ make MYPLAT=axplat-aarch64-bsta1000b defconfig
142
+ make MYPLAT=axplat-aarch64-bsta1000b A=examples/helloworld-myplat APP_FEATURES=aarch64-bsta1000b
143
+
144
+ - name : Build helloworld-myplat for aarch64-phytium-pi
145
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
146
+ run : |
147
+ make MYPLAT=axplat-aarch64-phytium-pi defconfig
148
+ make MYPLAT=axplat-aarch64-phytium-pi A=examples/helloworld-myplat APP_FEATURES=aarch64-phytium-pi
149
+
150
+ - name : Build helloworld-myplat for loongarch64-qemu-virt
151
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
152
+ run : |
153
+ make ARCH=loongarch64 defconfig
154
+ make ARCH=loongarch64 A=examples/helloworld-myplat SMP=4 APP_FEATURES=loongarch64-qemu-virt
155
+ make MYPLAT=axplat-loongarch64-qemu-virt A=examples/helloworld-myplat SMP=4 APP_FEATURES=loongarch64-qemu-virt
156
+
157
+ - name : Build helloworld-myplat for riscv64-qemu-virt
158
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
159
+ run : |
160
+ make ARCH=riscv64 defconfig
161
+ make ARCH=riscv64 A=examples/helloworld-myplat SMP=4 APP_FEATURES=riscv64-qemu-virt
162
+ make MYPLAT=axplat-riscv64-qemu-virt A=examples/helloworld-myplat SMP=4 APP_FEATURES=riscv64-qemu-virt
163
+
164
+
165
+ # Test platform `aarch64-raspi4` for various apps
166
+ - name : Setup aarch64-raspi4
167
+ run : |
168
+ git checkout .
169
+ make MYPLAT=axplat-aarch64-raspi defconfig
170
+ cargo axplat add axplat-aarch64-raspi -p arceos-helloworld -F smp --git https://github.com/arceos-org/axhal_crates.git
171
+ cargo axplat add axplat-aarch64-raspi -p arceos-shell -F smp --git https://github.com/arceos-org/axhal_crates.git
172
+ echo "extern crate axplat_aarch64_raspi;" >> examples/helloworld/src/main.rs
173
+ echo "extern crate axplat_aarch64_raspi;" >> examples/shell/src/main.rs
118
174
- name : Build helloworld for aarch64-raspi4
119
175
continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
120
- run : make PLATFORM= aarch64-raspi4 SMP=4 A=examples/helloworld
176
+ run : make MYPLAT=axplat- aarch64-raspi A=examples/helloworld
121
177
- name : Build shell for aarch64-raspi4
122
178
continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
123
- run : make PLATFORM= aarch64-raspi4 SMP=4 A=examples/shell FEATURES=page-alloc-4g,driver-bcm2835-sdhci BUS=mmio
179
+ run : make MYPLAT=axplat- aarch64-raspi A=examples/shell FEATURES=page-alloc-4g,driver-bcm2835-sdhci BUS=mmio
124
180
125
- - run : make PLATFORM=aarch64-bsta1000b defconfig
181
+ # Test platform `aarch64-bsta1000b` for various apps
182
+ - name : Setup aarch64-bsta1000b
183
+ run : |
184
+ git checkout .
185
+ make MYPLAT=axplat-aarch64-bsta1000b defconfig
186
+ cargo axplat add axplat-aarch64-bsta1000b -p arceos-helloworld -F smp --git https://github.com/arceos-org/axhal_crates.git
187
+ cargo axplat add axplat-aarch64-bsta1000b -p arceos-shell -F smp --git https://github.com/arceos-org/axhal_crates.git
188
+ echo "extern crate axplat_aarch64_bsta1000b;" >> examples/helloworld/src/main.rs
189
+ echo "extern crate axplat_aarch64_bsta1000b;" >> examples/shell/src/main.rs
126
190
- name : Build helloworld for aarch64-bsta1000b
127
191
continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
128
- run : make PLATFORM=aarch64-bsta1000b A=examples/helloworld SMP=8
192
+ run : make MYPLAT=axplat-aarch64-bsta1000b A=examples/helloworld
193
+ - name : Build shell for aarch64-bsta1000b
194
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
195
+ run : make MYPLAT=axplat-aarch64-bsta1000b A=examples/shell FEATURES=page-alloc-4g,driver-ramdisk BUS=mmio
129
196
130
- - run : make PLATFORM=aarch64-phytium-pi defconfig
197
+ # Test platform `aarch64-phytium-pi` for various apps
198
+ - name : Setup aarch64-phytium-pi
199
+ run : |
200
+ git checkout .
201
+ make MYPLAT=axplat-aarch64-phytium-pi defconfig
202
+ cargo axplat add axplat-aarch64-phytium-pi -p arceos-helloworld -F smp --git https://github.com/arceos-org/axhal_crates.git
203
+ cargo axplat add axplat-aarch64-phytium-pi -p arceos-shell -F smp --git https://github.com/arceos-org/axhal_crates.git
204
+ echo "extern crate axplat_aarch64_phytium_pi;" >> examples/helloworld/src/main.rs
205
+ echo "extern crate axplat_aarch64_phytium_pi;" >> examples/shell/src/main.rs
131
206
- name : Build helloworld for aarch64-phytium-pi
132
207
continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
133
- run : make PLATFORM=aarch64-phytium-pi A=examples/helloworld SMP=4
208
+ run : make MYPLAT=axplat-aarch64-phytium-pi A=examples/helloworld
209
+ - name : Build shell for aarch64-phytium-pi
210
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
211
+ run : make MYPLAT=axplat-aarch64-phytium-pi A=examples/shell FEATURES=page-alloc-4g,driver-ramdisk BUS=mmio
134
212
135
- - uses : ./.github/workflows/actions/setup-musl
213
+ # Test various config files for C apps
214
+ - uses : arceos-org/setup-musl@v1
136
215
with :
137
216
arch : x86_64
138
- - run : make PLATFORM=x86_64-pc-oslab defconfig
217
+ - name : Setup x86_64-pc-oslab for C apps
218
+ run : make PLAT_CONFIG=$(pwd)/configs/custom/x86_64-pc-oslab.toml defconfig
139
219
- name : Build helloworld-c for x86_64-pc-oslab
140
220
continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
141
- run : make PLATFORM= x86_64-pc-oslab A=examples/helloworld-c
221
+ run : make PLAT_CONFIG=$(pwd)/configs/custom/ x86_64-pc-oslab.toml A=examples/helloworld-c
142
222
- name : Build httpclient-c for x86_64-pc-oslab
143
223
continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
144
- run : make PLATFORM= x86_64-pc-oslab A=examples/httpclient-c FEATURES=page-alloc-4g,driver-ixgbe
224
+ run : make PLAT_CONFIG=$(pwd)/configs/custom/ x86_64-pc-oslab.toml A=examples/httpclient-c FEATURES=page-alloc-4g,driver-ixgbe
145
225
- name : Build httpserver-c for x86_64-pc-oslab
146
226
continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
147
- run : make PLATFORM= x86_64-pc-oslab A=examples/httpserver-c FEATURES=page-alloc-4g,driver-ixgbe
227
+ run : make PLAT_CONFIG=$(pwd)/configs/custom/ x86_64-pc-oslab.toml A=examples/httpserver-c FEATURES=page-alloc-4g,driver-ixgbe
148
228
229
+ # Necessary checks for macOS builds
230
+ build-for-macos :
231
+ runs-on : macos-latest
232
+ strategy :
233
+ fail-fast : false
234
+ matrix :
235
+ rust-toolchain : [nightly, nightly-2025-05-20]
236
+ steps :
237
+ - uses : actions/checkout@v4
238
+ - uses : dtolnay/rust-toolchain@stable
239
+ with :
240
+ toolchain : ${{ matrix.rust-toolchain }}
241
+ components : rust-src, clippy
242
+ targets : x86_64-unknown-none
243
+ - uses : Swatinem/rust-cache@v2
244
+ with :
245
+ shared-key : cargo-bin-cache
246
+ cache-targets : false
247
+ - name : Clippy for the default target
248
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
249
+ run : make clippy
250
+
251
+ - run : cargo install cargo-binutils
252
+ - name : Build helloworld
253
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
254
+ run : make A=examples/helloworld
255
+
256
+ # Test for other platforms
257
+ - run : make PLATFORM=x86_64-pc-oslab defconfig
258
+ - name : Build helloworld for x86_64-pc-oslab
259
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
260
+ run : make PLATFORM=x86_64-pc-oslab A=examples/helloworld
261
+ - name : Build shell for x86_64-pc-oslab
262
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
263
+ run : make PLATFORM=x86_64-pc-oslab A=examples/shell FEATURES=page-alloc-4g,driver-ramdisk
264
+
265
+ - run : make PLATFORM=aarch64-raspi4 defconfig
266
+ - name : Build helloworld for aarch64-raspi4
267
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
268
+ run : make PLATFORM=aarch64-raspi4 SMP=4 A=examples/helloworld
269
+
270
+ - run : make PLATFORM=aarch64-bsta1000b defconfig
271
+ - name : Build helloworld for aarch64-bsta1000b
272
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
273
+ run : make PLATFORM=aarch64-bsta1000b A=examples/helloworld SMP=8
274
+
275
+ - run : make PLATFORM=aarch64-phytium-pi defconfig
276
+ - name : Build helloworld for aarch64-phytium-pi
277
+ continue-on-error : ${{ matrix.rust-toolchain == 'nightly' }}
278
+ run : make PLATFORM=aarch64-phytium-pi A=examples/helloworld SMP=4
0 commit comments