Skip to content

Commit e6900d0

Browse files
committed
[CI] check build and doc CI tasks under macOS
1 parent 9e97050 commit e6900d0

File tree

3 files changed

+52
-9
lines changed

3 files changed

+52
-9
lines changed

.github/workflows/build.yml

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ on: [push, pull_request]
44

55
jobs:
66
clippy:
7-
runs-on: ubuntu-latest
7+
runs-on: ${{ matrix.os }}
88
strategy:
99
fail-fast: false
1010
matrix:
11+
os: [ubuntu-latest, macos-latest]
1112
arch: [x86_64, riscv64, aarch64, loongarch64]
1213
rust-toolchain: [nightly, nightly-2025-05-20]
1314
env:
@@ -37,12 +38,12 @@ jobs:
3738
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
3839
run: make clippy ARCH=${{ matrix.arch }}
3940

40-
build:
41+
build-rust-apps:
4142
runs-on: ${{ matrix.os }}
4243
strategy:
4344
fail-fast: false
4445
matrix:
45-
os: [ubuntu-latest]
46+
os: [ubuntu-latest, macos-latest]
4647
arch: [x86_64, riscv64, aarch64, loongarch64]
4748
rust-toolchain: [nightly, nightly-2025-05-20]
4849
env:
@@ -72,6 +73,27 @@ jobs:
7273
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
7374
run: make ARCH=${{ matrix.arch }} A=examples/shell
7475

76+
build-c-apps:
77+
runs-on: ubuntu-latest
78+
strategy:
79+
fail-fast: false
80+
matrix:
81+
arch: [x86_64, riscv64, aarch64, loongarch64]
82+
rust-toolchain: [nightly, nightly-2025-05-20]
83+
env:
84+
RUSTUP_TOOLCHAIN: ${{ matrix.rust-toolchain }}
85+
steps:
86+
- uses: actions/checkout@v4
87+
- uses: dtolnay/rust-toolchain@stable
88+
with:
89+
toolchain: ${{ matrix.rust-toolchain }}
90+
components: rust-src, llvm-tools
91+
targets: x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat, loongarch64-unknown-none-softfloat
92+
- uses: Swatinem/rust-cache@v2
93+
with:
94+
shared-key: cargo-bin-cache
95+
cache-targets: false
96+
- run: cargo install cargo-binutils
7597
- uses: arceos-org/setup-musl@v1
7698
with:
7799
arch: ${{ matrix.arch }}
@@ -85,12 +107,12 @@ jobs:
85107
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
86108
run: make ARCH=${{ matrix.arch }} A=examples/httpserver-c
87109

88-
build-for-other-platforms:
110+
build-rust-apps-for-other-platforms:
89111
runs-on: ${{ matrix.os }}
90112
strategy:
91113
fail-fast: false
92114
matrix:
93-
os: [ubuntu-latest]
115+
os: [ubuntu-latest, macos-latest]
94116
rust-toolchain: [nightly, nightly-2025-05-20]
95117
env:
96118
RUSTUP_TOOLCHAIN: ${{ matrix.rust-toolchain }}
@@ -137,6 +159,26 @@ jobs:
137159
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
138160
run: make PLATFORM=aarch64-phytium-pi A=examples/helloworld SMP=4
139161

162+
build-c-apps-for-other-platforms:
163+
runs-on: ubuntu-latest
164+
strategy:
165+
fail-fast: false
166+
matrix:
167+
rust-toolchain: [nightly, nightly-2025-05-20]
168+
env:
169+
RUSTUP_TOOLCHAIN: ${{ matrix.rust-toolchain }}
170+
steps:
171+
- uses: actions/checkout@v4
172+
- uses: dtolnay/rust-toolchain@stable
173+
with:
174+
toolchain: ${{ matrix.rust-toolchain }}
175+
components: rust-src, llvm-tools
176+
targets: x86_64-unknown-none
177+
- uses: Swatinem/rust-cache@v2
178+
with:
179+
shared-key: cargo-bin-cache
180+
cache-targets: false
181+
- run: cargo install cargo-binutils
140182
- uses: arceos-org/setup-musl@v1
141183
with:
142184
arch: x86_64

.github/workflows/docs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ env:
77

88
jobs:
99
doc:
10-
runs-on: ubuntu-latest
10+
runs-on: ${{ matrix.os }}
1111
strategy:
12+
matrix:
13+
os: [ubuntu-latest, macos-latest]
1214
fail-fast: false
1315
permissions:
1416
contents: write
@@ -24,10 +26,9 @@ jobs:
2426
shared-key: cargo-bin-cache
2527
cache-targets: false
2628
- name: Build docs
27-
continue-on-error: ${{ github.ref != env.default-branch && github.event_name != 'pull_request' }}
2829
run: make doc_check_missing
2930
- name: Deploy to Github Pages
30-
if: ${{ github.ref == env.default-branch }}
31+
if: ${{ github.ref == env.default-branch && matrix.os == 'ubuntu-latest' }}
3132
uses: JamesIves/github-pages-deploy-action@v4
3233
with:
3334
single-commit: true

modules/axhal/src/platform/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Platform-specific operations.
22
33
cfg_if::cfg_if! {
4-
if #[cfg(target_arch = "aarch64")]{
4+
if #[cfg(all(target_arch = "aarch64", target_os = "none"))]{
55
mod aarch64_common;
66
}
77
}

0 commit comments

Comments
 (0)