Skip to content

Commit 3c8bce1

Browse files
committed
Add CI workflow and update test script for multi-architecture support
1 parent 0798b57 commit 3c8bce1

File tree

3 files changed

+57
-129
lines changed

3 files changed

+57
-129
lines changed

.axconfig.toml

Lines changed: 0 additions & 120 deletions
This file was deleted.

scripts/test.sh

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -e
33

4-
echo "=== ArceOS Helloworld Test Script ==="
4+
echo "=== ArceOS Childtask Test Script ==="
55
echo ""
66

77
# Check if required tools are installed
@@ -30,11 +30,35 @@ check_format() {
3030
echo ""
3131
}
3232

33-
# Clippy lint check
33+
# Clippy lint check by architecture
3434
check_clippy() {
3535
echo "[3/7] Running clippy lint checks..."
36-
cargo clippy -- -D warnings
37-
echo "✓ Clippy check passed"
36+
37+
local archs=("riscv64" "x86_64" "aarch64" "loongarch64")
38+
local targets=("riscv64gc-unknown-none-elf" "x86_64-unknown-none" "aarch64-unknown-none-softfloat" "loongarch64-unknown-none")
39+
40+
for i in "${!archs[@]}"; do
41+
local arch="${archs[$i]}"
42+
local target="${targets[$i]}"
43+
44+
echo ""
45+
echo "Running clippy for architecture: $arch"
46+
47+
# Install config file for the architecture
48+
cp "configs/${arch}.toml" ".axconfig.toml"
49+
50+
if cargo clippy --features axstd --target="$target" -- -D warnings; then
51+
echo "$arch clippy check passed"
52+
else
53+
echo "Error: $arch clippy check failed"
54+
rm -f .axconfig.toml
55+
exit 1
56+
fi
57+
done
58+
59+
rm -f .axconfig.toml
60+
echo ""
61+
echo "✓ All architecture clippy checks passed"
3862
echo ""
3963
}
4064

@@ -81,11 +105,35 @@ run_arch_tests() {
81105
echo ""
82106
}
83107

84-
# Publish dry-run check
108+
# Publish dry-run check by architecture
85109
check_publish() {
86110
echo "[6/7] Checking publish readiness..."
87-
cargo publish --dry-run --allow-dirty
88-
echo "✓ Publish check passed"
111+
112+
local archs=("riscv64" "x86_64" "aarch64" "loongarch64")
113+
local targets=("riscv64gc-unknown-none-elf" "x86_64-unknown-none" "aarch64-unknown-none-softfloat" "loongarch64-unknown-none")
114+
115+
for i in "${!archs[@]}"; do
116+
local arch="${archs[$i]}"
117+
local target="${targets[$i]}"
118+
119+
echo ""
120+
echo "Checking publish for architecture: $arch"
121+
122+
# Install config file for the architecture
123+
cp "configs/${arch}.toml" ".axconfig.toml"
124+
125+
if cargo publish --features axstd --dry-run --allow-dirty --target="$target"; then
126+
echo "$arch publish check passed"
127+
else
128+
echo "Error: $arch publish check failed"
129+
rm -f .axconfig.toml
130+
exit 1
131+
fi
132+
done
133+
134+
rm -f .axconfig.toml
135+
echo ""
136+
echo "✓ All architecture publish checks passed"
89137
echo ""
90138
}
91139

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ fn main() {
2727

2828
let worker1 = thread::spawn(move || {
2929
println!("worker1 checks code: ");
30-
for i in 0..8 {
31-
print!("{:#x} ", buf[i]);
30+
for b in buf.iter().take(8) {
31+
print!("{:#x} ", b);
3232
}
3333
println!("\nworker1 ok!");
3434
});

0 commit comments

Comments
 (0)