-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (113 loc) · 4.21 KB
/
qemu-eest-blockchain.yml
File metadata and controls
128 lines (113 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Qemu EESTs on RV32IM
on:
schedule:
- cron: "0 0 */3 * *" # Run every 3 days at midnight UTC
workflow_dispatch:
jobs:
build-and-run-rv32im:
name: Build and Run EEST Tests RV32IM (Ubuntu 25.10)
runs-on: ubuntu-latest
container: ubuntu:25.10
steps:
- name: Install system dependencies
env:
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC
run: |
apt update
apt install -y \
build-essential cmake ninja-build \
git git-lfs \
python3 python3-pip pipx \
nodejs npm \
qemu-system-misc
pipx install conan
pipx ensurepath
npm i -g xpm
xpm install @xpack-dev-tools/riscv-none-elf-gcc@latest --global --verbose
echo 'export PATH=$HOME/.local/xPacks/@xpack-dev-tools/riscv-none-elf-gcc/15.2.0-1.1/.content/bin:$PATH' >> ~/.bashrc
echo "PATH=$HOME/.local/xPacks/@xpack-dev-tools/riscv-none-elf-gcc/15.2.0-1.1/.content/bin:$PATH" >> $GITHUB_ENV
- name: Verify tool versions
run: |
riscv-none-elf-gcc --version
riscv-none-elf-g++ --version
cmake --version
ninja --version
git --version
git lfs version
python3 --version
ctest --version
qemu-system-riscv32 --version
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
lfs: true
- name: Build for RV32IM
run: |
cd qemu_runner && make xpack-elf-eest
- name: Run EESTs on qemu-riscv32
id: run_tests
shell: bash
run: |
set +e
cd qemu_runner
make rerun-ctest 2>&1 | tee output.log
exit_code=${PIPESTATUS[0]}
# Parse test results
if grep -q "tests passed" output.log; then
result_line=$(grep "tests passed" output.log | tail -1)
# Extract numbers: "X% tests passed, Y tests failed out of Z"
passed=$(echo "$result_line" | grep -oP '\d+(?=% tests passed)')
failed=$(echo "$result_line" | grep -oP '\d+(?= tests failed)')
total=$(echo "$result_line" | grep -oP '(?<=out of )\d+')
echo "passed_percent=$passed" >> $GITHUB_OUTPUT
echo "failed=$failed" >> $GITHUB_OUTPUT
echo "total=$total" >> $GITHUB_OUTPUT
echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
else
echo "passed_percent=0" >> $GITHUB_OUTPUT
echo "failed=-1" >> $GITHUB_OUTPUT
echo "total=0" >> $GITHUB_OUTPUT
echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
fi
- name: Print test summary
if: always()
shell: bash
run: |
echo "========================================"
echo " EEST TEST SUMMARY (RV32IM)"
echo "========================================"
echo ""
echo "Results: ${{ steps.run_tests.outputs.passed_percent }}% passed, ${{ steps.run_tests.outputs.failed }} failed out of ${{ steps.run_tests.outputs.total }}"
echo "========================================"
- name: Upload test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: eest-test-logs
path: |
qemu_runner/output.log
qemu_runner/build/Testing/Temporary/LastTest.log
retention-days: 30
- name: Check failure threshold
if: always()
shell: bash
run: |
failed=${{ steps.run_tests.outputs.failed }}
total=${{ steps.run_tests.outputs.total }}
exit_code=${{ steps.run_tests.outputs.exit_code }}
if [[ "$failed" == "-1" ]]; then
echo "ERROR: Could not parse test results"
exit 1
fi
if (( failed > 5 )); then
echo "Too many failures - ${failed} failed out of ${total}"
echo "failed" > failed.log
exit 1
fi
if (( failed > 0 )); then
echo "WARNING: ${failed} test(s) failed, but within acceptable threshold (<=5)"
else
echo "SUCCESS: All ${total} tests passed!"
fi