Skip to content

Commit 4708e2c

Browse files
committed
fix ci build
1 parent 602a303 commit 4708e2c

File tree

8 files changed

+62
-102
lines changed

8 files changed

+62
-102
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,29 @@ jobs:
1313
matrix:
1414
rust-toolchain: [nightly, nightly-2025-05-20]
1515
arch: [x86_64, riscv64, aarch64, loongarch64]
16+
include:
17+
- arch: x86_64
18+
target: x86_64-unknown-none
19+
- arch: riscv64
20+
target: riscv64gc-unknown-none-elf
21+
- arch: aarch64
22+
target: aarch64-unknown-none-softfloat
23+
- arch: loongarch64
24+
target: loongarch64-unknown-none-softfloat
1625
steps:
1726
- uses: actions/checkout@v4
1827
- uses: dtolnay/rust-toolchain@stable
1928
with:
2029
toolchain: ${{ matrix.rust-toolchain }}
2130
components: rust-src, clippy, rustfmt
22-
targets: x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none, aarch64-unknown-none-softfloat, loongarch64-unknown-none
23-
- name: Setup ArceOS
24-
run: ./scripts/get_deps.sh
31+
targets: ${{ matrix.target }}
2532
- name: Check rust version
2633
run: rustc --version --verbose
2734
- uses: arceos-org/setup-musl@v1
2835
with:
2936
arch: ${{ matrix.arch }}
37+
- name: Setup ArceOS
38+
run: ./scripts/get_deps.sh
3039
- name: Check code format
3140
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
3241
run: cargo fmt --all -- --check
@@ -35,86 +44,110 @@ jobs:
3544
run: make clippy ARCH=${{ matrix.arch }}
3645

3746
build:
38-
runs-on: ${{ matrix.os }}
47+
runs-on: ubuntu-latest
3948
strategy:
4049
fail-fast: false
4150
matrix:
42-
os: [ubuntu-latest]
4351
arch: [x86_64, riscv64, aarch64, loongarch64]
4452
rust-toolchain: [nightly, nightly-2025-05-20]
53+
include:
54+
- arch: x86_64
55+
target: x86_64-unknown-none
56+
- arch: riscv64
57+
target: riscv64gc-unknown-none-elf
58+
- arch: aarch64
59+
target: aarch64-unknown-none-softfloat
60+
- arch: loongarch64
61+
target: loongarch64-unknown-none-softfloat
4562
steps:
4663
- uses: actions/checkout@v4
4764
- uses: dtolnay/rust-toolchain@stable
4865
with:
4966
toolchain: ${{ matrix.rust-toolchain }}
5067
components: rust-src, llvm-tools
51-
targets: x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none, aarch64-unknown-none-softfloat, loongarch64-unknown-none
68+
targets: ${{ matrix.target }}
5269
- uses: Swatinem/rust-cache@v2
5370
with:
5471
shared-key: cargo-bin-cache
5572
cache-targets: false
56-
- run: cargo install cargo-binutils
57-
- run: ./scripts/get_deps.sh
5873
- uses: arceos-org/setup-musl@v1
5974
with:
6075
arch: ${{ matrix.arch }}
76+
- name: Setup ArceOS
77+
run: ./scripts/get_deps.sh
6178
- name: Build for ${{ matrix.arch }}
6279
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
6380
run: make ARCH=${{ matrix.arch }} build
6481

6582
test-musl:
66-
runs-on: ${{ matrix.os }}
83+
runs-on: ubuntu-latest
6784
strategy:
6885
fail-fast: false
6986
matrix:
70-
os: [ubuntu-latest]
7187
arch: [x86_64, riscv64, aarch64, loongarch64]
7288
rust-toolchain: [nightly-2025-05-20]
89+
include:
90+
- arch: x86_64
91+
target: x86_64-unknown-none
92+
- arch: riscv64
93+
target: riscv64gc-unknown-none-elf
94+
- arch: aarch64
95+
target: aarch64-unknown-none-softfloat
96+
- arch: loongarch64
97+
target: loongarch64-unknown-none-softfloat
7398
steps:
7499
- uses: actions/checkout@v4
75100
- uses: dtolnay/rust-toolchain@stable
76101
with:
77102
toolchain: ${{ matrix.rust-toolchain }}
78103
components: rust-src, llvm-tools
104+
targets: ${{ matrix.target }}
79105
- uses: Swatinem/rust-cache@v2
80106
with:
81107
shared-key: cargo-bin-cache
82108
cache-targets: false
83-
- run: cargo install cargo-binutils
84-
- run: ./scripts/get_deps.sh
85109
- uses: arceos-org/setup-musl@v1
86110
with:
87111
arch: ${{ matrix.arch }}
88112
- uses: arceos-org/setup-qemu@v1
89113
with:
90114
version: ${{ env.qemu-version }}
91115
arch_list: x86_64,aarch64,riscv64,loongarch64
116+
- name: Setup ArceOS
117+
run: ./scripts/get_deps.sh
92118
- name: Build rustup target
93119
if: ${{ matrix.arch != 'riscv64' }}
94120
run: rustup target add ${{ matrix.arch }}-unknown-linux-musl
95121
- name: Run tests for musl applications
96122
run: make test ARCH=${{ matrix.arch }}
97123

98124
test-oscomp:
99-
runs-on: ${{ matrix.os }}
125+
runs-on: ubuntu-latest
100126
strategy:
101127
fail-fast: false
102128
matrix:
103-
os: [ubuntu-latest]
104129
arch: [x86_64, riscv64, aarch64, loongarch64]
105130
rust-toolchain: [nightly-2025-05-20]
131+
include:
132+
- arch: x86_64
133+
target: x86_64-unknown-none
134+
- arch: riscv64
135+
target: riscv64gc-unknown-none-elf
136+
- arch: aarch64
137+
target: aarch64-unknown-none-softfloat
138+
- arch: loongarch64
139+
target: loongarch64-unknown-none-softfloat
106140
steps:
107141
- uses: actions/checkout@v4
108142
- uses: dtolnay/rust-toolchain@stable
109143
with:
110144
toolchain: ${{ matrix.rust-toolchain }}
111145
components: rust-src, llvm-tools
146+
targets: ${{ matrix.target }}
112147
- uses: Swatinem/rust-cache@v2
113148
with:
114149
shared-key: cargo-bin-cache
115150
cache-targets: false
116-
- run: cargo install cargo-binutils
117-
- run: ./scripts/get_deps.sh
118151
- uses: arceos-org/setup-musl@v1
119152
with:
120153
arch: ${{ matrix.arch }}
@@ -131,6 +164,8 @@ jobs:
131164
gunzip sdcard-${{ matrix.arch }}.img.gz
132165
- name: Build python environment
133166
run: sudo apt-get install -y python3 python3-pip
167+
- name: Setup ArceOS
168+
run: ./scripts/get_deps.sh
134169
- name: Run tests for oscomp musl testcases
135170
run: make oscomp_test ARCH=${{ matrix.arch }} LIBC=musl
136171
- name: Run tests for oscomp glibc testcases

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
with:
2424
shared-key: cargo-bin-cache
2525
cache-targets: false
26-
- run: cargo install cargo-binutils
27-
- run: ./scripts/get_deps.sh
2826
- uses: arceos-org/setup-musl@v1
2927
with:
3028
arch: x86_64
29+
- name: Setup ArceOS
30+
run: ./scripts/get_deps.sh
3131
- name: Build docs
3232
continue-on-error: ${{ github.ref != env.default-branch && github.event_name != 'pull_request' }}
3333
run: make doc

apps/libc/test_cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
test_one "LOG=off FEATURES=fp_simd BLK=y NET=y" "expect_off.out"
1+
test_one "LOG=off BLK=y NET=y" "expect_off.out"

apps/nimbos/test_cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
test_one "LOG=off FEATURES=fp_simd BLK=y NET=y" "expect_off.out"
1+
test_one "LOG=off BLK=y NET=y" "expect_off.out"

build.rs

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

scripts/app_test.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ if [ "$ARCH" != "x86_64" ] && [ "$ARCH" != "riscv64" ] && [ "$ARCH" != "aarch64"
2424
exit $S_FAILED
2525
fi
2626

27-
2827
function compare() {
2928
local actual=$1
3029
local expect=$2
@@ -34,13 +33,13 @@ function compare() {
3433
fi
3534
IFS=''
3635
while read -r line; do
37-
local matched=$(grep -m1 -a "$line" < "$actual")
36+
local matched=$(grep -m1 -a "$line" <"$actual")
3837
if [ -z "$matched" ]; then
3938
MSG="pattern \"${BLOD_C}$line${END_C}\" not matched!"
4039
unset IFS
4140
return $S_FAILED
4241
fi
43-
done < "$expect"
42+
done <"$expect"
4443
unset IFS
4544
return $S_PASS
4645
}
@@ -52,13 +51,13 @@ function run_and_compare() {
5251

5352
echo -ne " run with \"${BLOD_C}$args${END_C}\": "
5453

55-
make -C "$ROOT" AX_TESTCASE=$APP $args build > "$actual" 2>&1
54+
make -C "$ROOT" AX_TESTCASE=$APP $args build >"$actual" 2>&1
5655
if [ $? -ne 0 ]; then
5756
return $S_BUILD_FAILED
5857
fi
5958

6059
TIMEFORMAT='%3Rs'
61-
RUN_TIME=$( { time { timeout --foreground $TIMEOUT make -C "$ROOT" AX_TESTCASE=$APP $args justrun > "$actual" 2>&1; }; } 2>&1 )
60+
RUN_TIME=$({ time { timeout --foreground $TIMEOUT make -C "$ROOT" AX_TESTCASE=$APP $args justrun >"$actual" 2>&1; }; } 2>&1)
6261
local res=$?
6362
if [ $res == 124 ]; then
6463
return $S_TIMEOUT
@@ -74,13 +73,11 @@ function run_and_compare() {
7473
fi
7574
}
7675

77-
7876
function test_one() {
7977
local args=$1
8078
local expect="$APP_DIR/$2"
8179
local actual="$APP_DIR/actual.out"
82-
local config_file=$(realpath --relative-to=$AX_ROOT "$ROOT/configs/$ARCH.toml")
83-
args="$args ARCH=$ARCH ACCEL=n EXTRA_CONFIG=$config_file"
80+
args="$args ARCH=$ARCH ACCEL=n"
8481
rm -f "$actual"
8582

8683
MSG=

scripts/make/oscomp.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
oscomp_binary: ax_root defconfig
44
@cp -r $(PWD)/bin/* /root/.cargo/bin
5-
@make -C $(AX_ROOT) A=$(PWD) EXTRA_CONFIG=$(EXTRA_CONFIG) build
5+
@make -C $(AX_ROOT) A=$(PWD) build
66
@if [ "$(ARCH)" = "riscv64" ]; then \
77
cp $(OUT_BIN) kernel-rv; \
88
else \

scripts/oscomp_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fi
9090

9191
cp sdcard-$ARCH.img $AX_ROOT/disk.img
9292

93-
ARG="AX_TESTCASE=oscomp ARCH=$ARCH EXTRA_CONFIG=../configs/$ARCH.toml BLK=y NET=y FEATURES=lwext4_rs SMP=4 ACCEL=n LOG=off"
93+
ARG="AX_TESTCASE=oscomp ARCH=$ARCH BLK=y NET=y FEATURES=lwext4_rs SMP=4 ACCEL=n LOG=off"
9494

9595
echo -e "${GREEN_C}ARGS:${END_C} $ARG"
9696
if [ $? -ne 0 ]; then

0 commit comments

Comments
 (0)