Skip to content

Commit

Permalink
ci: mv ci to self-hosted server & add H extension tests to ci test (#143
Browse files Browse the repository at this point in the history
)

* func: add H extension tests to ci test

* ci: modify ci.yml

* ci: delete 'workflow dispatch'

* ci: adjust indent

* ci: fix some syntax problems in ci.yml

* ci: add riscv64-linux-gnu to PATH

* ci: add timeout to ci.yml

* checkpoint: modify cross-compile in ./resource/gcpt_restore/Makefile
  • Loading branch information
pxk27 authored Sep 1, 2023
1 parent 5210511 commit df86981
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 26 deletions.
73 changes: 48 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,35 @@
name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
riscv64-compile-check:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
basic-tests:
runs-on: nemu
continue-on-error: false
timeout-minutes: 10
name: nemu - Basics
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Setup env
run: |
sudo apt update
sudo apt install wget git tmux make gcc curl libreadline6-dev libsdl2-dev gcc-riscv64-linux-gnu zlib1g-dev device-tree-compiler autoconf
echo "NEMU_HOME=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "TEST_HOME=/nfs/home/share/ci-workloads/H-extension-tests" >> $GITHUB_ENV
- name: Build NEMU interpreter
run: |
export NEMU_HOME=$(pwd)
make riscv64-xs_defconfig
make -j
- name: test boot linux
run: |
export NEMU_HOME=$(pwd)
git submodule update --init ready-to-run
# test boot linux
./build/riscv64-nemu-interpreter -b ./ready-to-run/linux.bin
make clean-all
- name: test cpt taking and restoring
run: |
export NEMU_HOME=$(pwd)
make riscv64-xs-novga_defconfig
make -j
cd resource/gcpt_restore && make && cd $NEMU_HOME
Expand All @@ -52,17 +38,54 @@ jobs:
# restore cpt
bash ./scripts/restore.sh
make clean-all
- name: Build NEMU as difftest ref
run: |
export NEMU_HOME=$(pwd)
make riscv64-xs-ref_defconfig
make -j
make clean-all
- name: Build NEMU as difftest dual ref
run: |
export NEMU_HOME=$(pwd)
make riscv64-dual-xs-ref_defconfig
make -j
make clean-all
H-ext-tests:
runs-on: nemu
continue-on-error: false
name: nemu - H-extension
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- name: Setup env
run: |
echo "NEMU_HOME=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "TEST_HOME=/nfs/home/share/ci-workloads/H-extension-tests" >> $GITHUB_ENV
- name: Build NEMU with H extension as difftest ref
run: |
make riscv64-rvh-ref_defconfig
make clean-all
- name: Run Xvisor
run: |
make riscv64-rvh_defconfig
echo "#define CONFIG_DETERMINISTIC 1" >> ./include/generated/autoconf.h
make -j
./build/riscv64-nemu-interpreter -b $TEST_HOME/xvisor
make clean-all
- name: Run KVM
run: |
make riscv64-rvh_defconfig
make -j
./build/riscv64-nemu-interpreter -b $TEST_HOME/kvm
make clean-all
- name: Run Xvisor with DiffTest
run: |
make riscv64-rvh-diff-spike_defconfig
echo "#define CONFIG_DETERMINISTIC 1" >> ./include/generated/autoconf.h
make -j
./build/riscv64-nemu-interpreter -b -d $TEST_HOME/riscv64-spike-H-ext-so $TEST_HOME/xvisor
make clean-all
# - name: Run KVM with DiffTest
# run: |
# make riscv64-rvh-diff-spike_defconfig
# make -j
# ./build/riscv64-nemu-interpreter -b -d $TEST_HOME/riscv64-spike-H-ext-so $TEST_HOME/kvm
# make clean-all
2 changes: 1 addition & 1 deletion resource/gcpt_restore/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ BINARY ?= $(BUILD_DIR)/$(NAME)
.DEFAULT_GOAL = app

# Compilation flags
CROSS_COMPILE = riscv64-linux-gnu-
CROSS_COMPILE = riscv64-unknown-linux-gnu-
CC = $(CROSS_COMPILE)gcc
LD = $(CROSS_COMPILE)ld
OBJDUMP = $(CROSS_COMPILE)objdump
Expand Down

0 comments on commit df86981

Please sign in to comment.