Skip to content

Commit fe8a24b

Browse files
committed
Add CI workflow for building and testing
Improve CI workflow with QEMU, cpubench, timeout I notice that the cpu bench will make qemu into Scheduler mode: Preemptive so the qemu will not stop, add some trick to pass the test(not good) Refactor CI workflow for improved toolchain usage Comment out hello build and run step in CI workflow Update RISC-V toolchain and enable hello build step Add -bios none to QEMU commands in CI workflow Remove hello build and run step from CI workflow Add timeout to QEMU command in CI workflow Add completion message to cpubench CI step Allow QEMU step to pass without stopping CI job ci: refactor QEMU test workflow and extract scripts The workflow now extracts cpubench results from QEMU output and automatically comments the result on pull requests. Improve CI workflow with QEMU, cpubench, timeout I notice that the cpu bench will make qemu into Scheduler mode: Preemptive so the qemu will not stop, add some trick to pass the test(not good) Refactor CI workflow for improved toolchain usage Comment out hello build and run step in CI workflow Update RISC-V toolchain and enable hello build step Add -bios none to QEMU commands in CI workflow Remove hello build and run step from CI workflow Add timeout to QEMU command in CI workflow Add completion message to cpubench CI step Allow QEMU step to pass without stopping CI job Fix merge conflict markers in CI workflow file Use Ubuntu 24.04 in CI workflow Remove merge conflict markers from error.c Remove merge conflict markers from error.h Remove redundant libc.h include from libc.c Delete libc.c Add CI scripts and refactor workflow - Move toolchain setup, build, QEMU run, and result extraction to dedicated scripts in .ci/ - Update ci.yml to use these scripts for improved maintainability Make CI scripts executable Add flexible test sequencing and CI test suites - Replace run-qemu.sh with run-test-sequence.sh for configurable, robust test execution (supports timeouts, app lists, output dirs, continue-on-failure, and verbosity) - Add run-qemu-tests.sh for simple sequential app testing - Add test suite definitions: basic.txt, performance.txt, comprehensive.txt - Overhaul extract-result.sh to aggregate, summarize, and format results for GitHub Actions and artifacts - Update CI workflow to run multiple test suites (basic, performance, comprehensive, custom), upload artifacts, and generate a consolidated summary - Remove obsolete run-qemu.sh script Simplify CI test runner and result extraction Comment PR with benchmark results in CI workflow Run all basic apps in CI and comment results on PRs Remove extract-result.sh and update CI to inline test output Update QEMU tests to run cpubench and test64 only Inline build steps in CI workflow and remove build.sh
1 parent 3ec436c commit fe8a24b

File tree

2 files changed

+10
-58
lines changed

2 files changed

+10
-58
lines changed

.ci/setup-toolchain.sh

Lines changed: 6 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,11 @@
11
#!/bin/bash
22
set -e
33

4-
# Default to GNU if no toolchain specified
5-
TOOLCHAIN_TYPE=${1:-gnu}
4+
URL="https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2025.06.13/riscv32-elf-ubuntu-22.04-gcc-nightly-2025.06.13-nightly.tar.xz"
65

7-
TOOLCHAIN_REPO=https://github.com/riscv-collab/riscv-gnu-toolchain
8-
TOOLCHAIN_VERSION=2025.07.03
9-
TOOLCHAIN_OS=ubuntu-24.04
6+
echo "[+] Downloading RISC-V GNU toolchain..."
7+
wget "$URL"
8+
tar -xf "$(basename "$URL")"
109

11-
setup_gnu_toolchain() {
12-
echo "[+] Setting up GNU RISC-V toolchain..."
13-
14-
local URL="${TOOLCHAIN_REPO}/releases/download/${TOOLCHAIN_VERSION}/riscv32-elf-${TOOLCHAIN_OS}-gcc-nightly-${TOOLCHAIN_VERSION}-nightly.tar.xz"
15-
16-
echo "[+] Downloading RISC-V GNU toolchain..."
17-
wget -q "$URL"
18-
tar -xf "$(basename "$URL")"
19-
20-
echo "[+] Exporting GNU toolchain path..."
21-
echo "$PWD/riscv/bin" >> "$GITHUB_PATH"
22-
23-
# Set cross-compile prefix for GNU
24-
echo "CROSS_COMPILE=riscv32-unknown-elf-" >> "$GITHUB_ENV"
25-
echo "TOOLCHAIN_TYPE=gnu" >> "$GITHUB_ENV"
26-
}
27-
28-
setup_llvm_toolchain() {
29-
echo "[+] Setting up LLVM RISC-V toolchain..."
30-
31-
# upstream URL for LLVM toolchain
32-
local URL="${TOOLCHAIN_REPO}/releases/download/${TOOLCHAIN_VERSION}/riscv32-elf-${TOOLCHAIN_OS}-llvm-nightly-${TOOLCHAIN_VERSION}-nightly.tar.xz"
33-
34-
echo "[+] Downloading RISC-V LLVM toolchain..."
35-
wget -q "$URL"
36-
tar -xf "$(basename "$URL")"
37-
38-
echo "[+] Exporting LLVM toolchain path..."
39-
echo "$PWD/riscv/bin" >> "$GITHUB_PATH"
40-
41-
# Set cross-compile prefix for LLVM
42-
echo "CROSS_COMPILE=riscv32-unknown-elf-" >> "$GITHUB_ENV"
43-
echo "TOOLCHAIN_TYPE=llvm" >> "$GITHUB_ENV"
44-
echo "AR=llvm-ar" >> "$GITHUB_ENV"
45-
}
46-
47-
case "$TOOLCHAIN_TYPE" in
48-
"gnu")
49-
setup_gnu_toolchain
50-
;;
51-
"llvm")
52-
setup_llvm_toolchain
53-
;;
54-
*)
55-
echo "Error: Unknown toolchain type '$TOOLCHAIN_TYPE'"
56-
echo "Usage: $0 [gnu|llvm]"
57-
exit 1
58-
;;
59-
esac
60-
61-
echo "[+] Toolchain setup complete: $TOOLCHAIN_TYPE"
10+
echo "[+] Exporting toolchain path..."
11+
echo "$PWD/riscv/bin" >> "$GITHUB_PATH"

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: Linmo CI
22

33
on:
44
push:
5+
branches: [main, ci]
56
pull_request:
7+
branches: [main, ci]
68

79
jobs:
810
basic-tests:
@@ -18,8 +20,8 @@ jobs:
1820
sudo apt-get update
1921
sudo apt-get install -y build-essential qemu-system-riscv32 wget
2022
21-
- name: Setup GNU RISC-V Toolchain
22-
run: .ci/setup-toolchain.sh gnu
23+
- name: Setup RISC-V Toolchain
24+
run: .ci/setup-toolchain.sh
2325

2426
- name: Verify toolchain installation
2527
run: |

0 commit comments

Comments
 (0)