diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c725678d..1c8acca4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ -# wheatfox # hvisor Github Actions CI -# version: 2025.2.28 +# wheatfox + name: CI on: push: @@ -14,9 +14,9 @@ on: workflow_dispatch: env: MODE: debug - BOARD: qemu # we can only run auto tests in emulator... jobs: - fmt: + + linter: name: linter runs-on: ubuntu-latest steps: @@ -26,10 +26,12 @@ jobs: uses: dtolnay/rust-toolchain@stable with: components: rustfmt - - name: linter + - name: Format Check run: make fmt-test - test: - name: test + + # this job uses `cargo test` semantics to run unit test exclusively in QEMU + unittest: + name: unittest runs-on: ubuntu-latest strategy: fail-fast: false # continue to run all jobs even if some fail @@ -39,12 +41,14 @@ jobs: - arch: aarch64 rustc_target: aarch64-unknown-none features: "platform_qemu,gicv3" + board: "qemu" - arch: aarch64 rustc_target: aarch64-unknown-none features: "platform_qemu,gicv2" - - # riscv64 will be supported in the future but not now, - # let's first focus on unittest and system test(root linux) in aarch64 qemu... + board: "qemu" + # riscv64 will be supported in the future but not now, + # because our `make test` uses customized script to run tests, which need extra efforts to + # support riscv64 # - arch: riscv64 # rustc_target: riscv64gc-unknown-none-elf @@ -52,7 +56,6 @@ jobs: # - arch: riscv64 # rustc_target: riscv64gc-unknown-none-elf # features: "platform_qemu,aia" - steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -71,7 +74,75 @@ jobs: run: | echo "ARCH=${{ matrix.arch }}" >> $GITHUB_ENV echo "FEATURES=${{ matrix.features }}" >> $GITHUB_ENV - - name: build - run: make - - name: unittest + - name: Unit Test run: make test + + # this job is for compilation test, it will make sure all aaarch64, riscv64, loongarch64 can be compiled successfully + # there is no actual running in this job + build: + name: build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + # aarch64 + - arch: aarch64 + rustc_target: aarch64-unknown-none + features: "platform_qemu,gicv3" + board: "qemu" + - arch: aarch64 + rustc_target: aarch64-unknown-none + features: "platform_qemu,gicv2" + board: "qemu" + - arch: aarch64 + rustc_target: aarch64-unknown-none + features: "platform_zcu102,gicv2" + board: "zcu102" + - arch: aarch64 + rustc_target: aarch64-unknown-none + features: "platform_imx8mp,gicv3" + board: "qemu" + # riscv64 + - arch: riscv64 + rustc_target: riscv64gc-unknown-none-elf + features: "platform_qemu,plic" + board: "qemu" + - arch: riscv64 + rustc_target: riscv64gc-unknown-none-elf + features: "platform_qemu,aia" + board: "qemu" + # loongarch64 + - arch: loongarch64 + rustc_target: loongarch64-unknown-none + features: "" + board: "3a5000" + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Install Rust Toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.rustc_target }} + components: rust-src + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y wget + cargo install --version 0.3.0 cargo-binutils + cargo install cargo-xbuild + wget -q https://github.com/sunhaiyong1978/CLFS-for-LoongArch/releases/download/8.0/loongarch64-clfs-8.0-cross-tools-gcc-full.tar.xz + tar -xf loongarch64-clfs-8.0-cross-tools-gcc-full.tar.xz + echo "$GITHUB_WORKSPACE/cross-tools/bin" >> $GITHUB_PATH + - name: Set up environment variables + run: | + echo "ARCH=${{ matrix.arch }}" >> $GITHUB_ENV + echo "FEATURES=${{ matrix.features }}" >> $GITHUB_ENV + echo "BOARD=${{ matrix.board }}" >> $GITHUB_ENV + - name: Build + run: make + + # this job is for booting root and nonroot inside qemu for system test + # curently waiting for another person to add his system test here + # systemtest: + # ... diff --git a/Makefile b/Makefile index afc17d11..9cfd5dac 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ OBJCOPY ?= rust-objcopy --binary-architecture=$(ARCH) FEATURES ?= platform_qemu,gicv3 # AVAIABLE "BOARD" VALUES: -# - qemu, zcu102, imx8mp, 3a5000 +# - qemu, zcu102, 3a5000 BOARD ?= qemu ifeq ($(ARCH),aarch64) diff --git a/src/device/irqchip/mod.rs b/src/device/irqchip/mod.rs index c676a7d7..7295e110 100644 --- a/src/device/irqchip/mod.rs +++ b/src/device/irqchip/mod.rs @@ -24,9 +24,6 @@ pub mod plic; #[cfg(feature = "aia")] pub mod aia; -#[cfg(target_arch = "loongarch64")] -pub mod ls7a2000; - pub fn gic_handle_irq() { #[cfg(all(feature = "gicv2", target_arch = "aarch64"))] gicv2::gic::gicv2_handle_irq();