Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add qemu boot test #8

Merged
merged 2 commits into from
May 8, 2024
Merged
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
48 changes: 46 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci-build
name: xuantie-kernel-ci

on:
push:
Expand All @@ -18,7 +18,7 @@ env:
rv64ilp32_toolchain_file_name: riscv64ilp32-elf-ubuntu-22.04-gcc-nightly-2024.03.08-nightly.tar.gz

jobs:
kernel:
kernel-build:
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -200,3 +200,47 @@ jobs:
name: ${{ matrix.name }}.tar.gz
path: ${{ matrix.name }}.tar.gz
retention-days: 90


qemu-boot-64lp64:
needs: kernel-build
runs-on: ubuntu-latest
container: ghcr.io/ruyisdk/linux-xuantie-kernel/xuantie-qemu:latest
strategy:
fail-fast: false
matrix:
cpu: [ c906fdv , c907fdvm-rv64 , c908v , c920 , c920v2]
kernel: [ linux-64lp64 , linux-64lp64-dirty ]
exclude:
- cpu: c920
kernel: linux-64lp64-dirty
include:
- core_count: 4
- cpu: c906fdv
core_count: 1


steps:

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ${{ matrix.kernel }}.tar.gz

- name: Download rootfs
run: |
wget -qc https://github.com/c-sky/buildroot/releases/download/v1.0.11/920v2_images.tar.gz
tar -xvf 920v2_images.tar.gz
tar -xvf ${{ matrix.kernel }}.tar.gz

- name: Run Qemu
run: |
qemu-system-riscv64 -cpu ${{ matrix.cpu }} -nographic -smp ${{ matrix.core_count }} -M virt -kernel ./Image -append 'rootwait root=/dev/vda ro' -drive file=./images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -monitor none -serial file:qemu_boot.log &
QEMU_PID=$!
sleep 180
kill -9 $QEMU_PID

- name: Check Boot Success
run: |
cat qemu_boot.log
grep -q "login:" qemu_boot.log