Skip to content

feat(mm): 实现帧分配器 #24

feat(mm): 实现帧分配器

feat(mm): 实现帧分配器 #24

Workflow file for this run

name: Run tests
on: [push]
env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: nightly-2025-01-13
QEMU_VERSION: qemu-9.2.1
QEMU_BUILD_PATH: ${{ github.workspace }}/qemu-build-cache
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout code
uses: actions/checkout@v4
# --- 1. 缓存 Cargo 依赖项 ---
- name: 📦 Cache Cargo Dependencies & Build Artifacts
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ env.RUST_TOOLCHAIN }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ env.RUST_TOOLCHAIN }}-
# --- 2. 安装 Rust Toolchain 和 Target ---
- name: 🛠️ Setup Rust Toolchain and Target
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
targets: riscv64gc-unknown-none-elf
components: rust-src, rustfmt, clippy, llvm-tools-preview
- name: Install cargo-binutils
run: cargo install cargo-binutils
# --- 3. QEMU 编译和缓存 ---
- name: 🧱 Install QEMU Dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev \
gawk build-essential bison flex texinfo gperf libtool patchutils bc \
zlib1g-dev libexpat1-dev pkg-config libglib2.0-dev libpixman-1-dev libsdl2-dev libslirp-dev \
python3 python3-pip ninja-build
- name: 📥 Cache QEMU Build and Installation
uses: actions/cache@v4
id: qemu-cache
with:
path: ${{ env.QEMU_BUILD_PATH }}
key: ${{ runner.os }}-qemu-${{ env.QEMU_VERSION }}-riscv64
restore-keys: |
${{ runner.os }}-qemu-${{ env.QEMU_VERSION }}-
- name: ⚙️ Compile and Install QEMU (if cache miss)
if: steps.qemu-cache.outputs.cache-hit != 'true'
run: |
wget https://download.qemu.org/${{ env.QEMU_VERSION }}.tar.xz
tar -xf ${{ env.QEMU_VERSION }}.tar.xz
mkdir -p ${{ env.QEMU_BUILD_PATH }}
cd ${{ env.QEMU_VERSION }}
# 配置 QEMU 目标列表
./configure --target-list=riscv64-softmmu --prefix=${{ env.QEMU_BUILD_PATH }} --disable-sdl
make -j$(nproc)
make install
echo "${{ env.QEMU_BUILD_PATH }}/bin" >> $GITHUB_PATH
- name: ➕ Add QEMU to PATH
if: steps.qemu-cache.outputs.cache-hit == 'true'
run: echo "${{ env.QEMU_BUILD_PATH }}/bin" >> $GITHUB_PATH
- name: 🏃 Run usertests
run: cd os && make run TEST=1
timeout-minutes: 10