Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 85 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# wheatfox <[email protected]>
# hvisor Github Actions CI
# version: 2025.2.28
# wheatfox <[email protected]>

name: CI
on:
push:
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -39,20 +41,21 @@ 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
# features: "platform_qemu,plic"
# - arch: riscv64
# rustc_target: riscv64gc-unknown-none-elf
# features: "platform_qemu,aia"

steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand All @@ -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:
# ...
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions src/device/irqchip/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down