Update ArceOS #274
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
env: | |
qemu-version: 9.2.4 | |
jobs: | |
clippy: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
rust-toolchain: [nightly, nightly-2025-05-20] | |
arch: [x86_64, riscv64, aarch64, loongarch64] | |
include: | |
- arch: x86_64 | |
target: x86_64-unknown-none | |
- arch: riscv64 | |
target: riscv64gc-unknown-none-elf | |
- arch: aarch64 | |
target: aarch64-unknown-none-softfloat | |
- arch: loongarch64 | |
target: loongarch64-unknown-none-softfloat | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ matrix.rust-toolchain }} | |
components: rust-src, clippy, rustfmt | |
targets: ${{ matrix.target }} | |
- name: Check rust version | |
run: rustc --version --verbose | |
- uses: arceos-org/setup-musl@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- name: Setup ArceOS | |
run: ./scripts/get_deps.sh | |
- name: Check code format | |
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }} | |
run: cargo fmt --all -- --check | |
- name: Clippy | |
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }} | |
run: make clippy ARCH=${{ matrix.arch }} | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x86_64, riscv64, aarch64, loongarch64] | |
rust-toolchain: [nightly, nightly-2025-05-20] | |
include: | |
- arch: x86_64 | |
target: x86_64-unknown-none | |
- arch: riscv64 | |
target: riscv64gc-unknown-none-elf | |
- arch: aarch64 | |
target: aarch64-unknown-none-softfloat | |
- arch: loongarch64 | |
target: loongarch64-unknown-none-softfloat | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ matrix.rust-toolchain }} | |
components: rust-src, llvm-tools | |
targets: ${{ matrix.target }} | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: cargo-bin-cache | |
cache-targets: false | |
- uses: arceos-org/setup-musl@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- name: Setup ArceOS | |
run: ./scripts/get_deps.sh | |
- name: Build for ${{ matrix.arch }} | |
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }} | |
run: make ARCH=${{ matrix.arch }} build | |
test-musl: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x86_64, riscv64, aarch64, loongarch64] | |
rust-toolchain: [nightly-2025-05-20] | |
include: | |
- arch: x86_64 | |
target: x86_64-unknown-none | |
- arch: riscv64 | |
target: riscv64gc-unknown-none-elf | |
- arch: aarch64 | |
target: aarch64-unknown-none-softfloat | |
- arch: loongarch64 | |
target: loongarch64-unknown-none-softfloat | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ matrix.rust-toolchain }} | |
components: rust-src, llvm-tools | |
targets: ${{ matrix.target }} | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: cargo-bin-cache | |
cache-targets: false | |
- uses: arceos-org/setup-musl@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- uses: arceos-org/setup-qemu@v1 | |
with: | |
version: ${{ env.qemu-version }} | |
arch_list: x86_64,aarch64,riscv64,loongarch64 | |
- name: Setup ArceOS | |
run: ./scripts/get_deps.sh | |
- name: Build rustup target | |
if: ${{ matrix.arch != 'riscv64' }} | |
run: rustup target add ${{ matrix.arch }}-unknown-linux-musl | |
- name: Run tests for musl applications | |
run: make test ARCH=${{ matrix.arch }} | |
test-oscomp: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x86_64, riscv64, aarch64, loongarch64] | |
rust-toolchain: [nightly-2025-05-20] | |
include: | |
- arch: x86_64 | |
target: x86_64-unknown-none | |
- arch: riscv64 | |
target: riscv64gc-unknown-none-elf | |
- arch: aarch64 | |
target: aarch64-unknown-none-softfloat | |
- arch: loongarch64 | |
target: loongarch64-unknown-none-softfloat | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ matrix.rust-toolchain }} | |
components: rust-src, llvm-tools | |
targets: ${{ matrix.target }} | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: cargo-bin-cache | |
cache-targets: false | |
- uses: arceos-org/setup-musl@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- uses: arceos-org/setup-qemu@v1 | |
with: | |
version: ${{ env.qemu-version }} | |
arch_list: x86_64,aarch64,riscv64,loongarch64 | |
- uses: ./.github/workflows/actions/setup-testcases | |
with: | |
image-release-url: https://github.com/Azure-stars/testsuits-for-oskernel/releases/download/v0.2 | |
arch: ${{ matrix.arch }} | |
- name: Unzip testcases | |
run: | | |
gunzip sdcard-${{ matrix.arch }}.img.gz | |
- name: Build python environment | |
run: sudo apt-get install -y python3 python3-pip | |
- name: Setup ArceOS | |
run: ./scripts/get_deps.sh | |
- name: Run tests for oscomp musl testcases | |
run: make oscomp_test ARCH=${{ matrix.arch }} LIBC=musl | |
- name: Run tests for oscomp glibc testcases | |
run: make oscomp_test ARCH=${{ matrix.arch }} LIBC=glibc |