Skip to content

Commit aebc7dd

Browse files
authored
Merge pull request #2 from erigontech/som/eest_workflow
workflows: Add EEST workflow
2 parents 65142f9 + 85a10d0 commit aebc7dd

File tree

2 files changed

+120
-2
lines changed

2 files changed

+120
-2
lines changed
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: EEST Blockchain Tests
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
eest-blockchain-tests:
12+
name: Run EEST Blockchain Tests
13+
runs-on: ubuntu-latest
14+
container: ubuntu:25.10
15+
steps:
16+
- name: Install system dependencies
17+
env:
18+
DEBIAN_FRONTEND: noninteractive
19+
TZ: Etc/UTC
20+
run: |
21+
apt update
22+
apt install -y \
23+
build-essential \
24+
g++-15 \
25+
cmake \
26+
ninja-build \
27+
git \
28+
git-lfs \
29+
python3 \
30+
python3-pip \
31+
pipx
32+
pipx install conan
33+
pipx ensurepath
34+
35+
- name: Verify tool versions
36+
run: |
37+
gcc --version
38+
g++ --version
39+
cmake --version
40+
ninja --version
41+
git --version
42+
git lfs version
43+
python3 --version
44+
ctest --version
45+
46+
- name: Checkout repository
47+
uses: actions/checkout@v4
48+
with:
49+
submodules: recursive
50+
lfs: true
51+
52+
- name: Run EEST blockchain tests
53+
id: run_tests
54+
shell: bash
55+
run: |
56+
set +e
57+
make eest-blockchain-tests 2>&1 | tee output.log
58+
exit_code=${PIPESTATUS[0]}
59+
60+
# Parse test results
61+
if grep -q "tests passed" output.log; then
62+
result_line=$(grep "tests passed" output.log | tail -1)
63+
# Extract numbers: "X% tests passed, Y tests failed out of Z"
64+
passed=$(echo "$result_line" | grep -oP '\d+(?=% tests passed)')
65+
failed=$(echo "$result_line" | grep -oP '\d+(?= tests failed)')
66+
total=$(echo "$result_line" | grep -oP '(?<=out of )\d+')
67+
68+
echo "passed_percent=$passed" >> $GITHUB_OUTPUT
69+
echo "failed=$failed" >> $GITHUB_OUTPUT
70+
echo "total=$total" >> $GITHUB_OUTPUT
71+
echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
72+
else
73+
echo "passed_percent=0" >> $GITHUB_OUTPUT
74+
echo "failed=-1" >> $GITHUB_OUTPUT
75+
echo "total=0" >> $GITHUB_OUTPUT
76+
echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
77+
fi
78+
79+
- name: Print test summary
80+
run: |
81+
echo "========================================"
82+
echo " EEST TEST SUMMARY"
83+
echo "========================================"
84+
echo ""
85+
echo "Results: ${{ steps.run_tests.outputs.passed_percent }}% passed, ${{ steps.run_tests.outputs.failed }} failed out of ${{ steps.run_tests.outputs.total }}"
86+
echo "========================================"
87+
88+
- name: Upload test logs
89+
if: always()
90+
uses: actions/upload-artifact@v4
91+
with:
92+
name: eest-test-logs
93+
path: |
94+
output.log
95+
build/eest/Testing/Temporary/LastTest.log
96+
retention-days: 30
97+
98+
- name: Check failure threshold
99+
run: |
100+
failed=${{ steps.run_tests.outputs.failed }}
101+
total=${{ steps.run_tests.outputs.total }}
102+
exit_code=${{ steps.run_tests.outputs.exit_code }}
103+
104+
if [[ "$failed" == "-1" ]]; then
105+
echo "ERROR: Could not parse test results"
106+
exit 1
107+
fi
108+
109+
if (( failed > 5 )); then
110+
echo "Too many failures - ${failed} failed out of ${total}"
111+
echo "failed" > failed.log
112+
exit 1
113+
fi
114+
115+
if (( failed > 0 )); then
116+
echo "WARNING: ${failed} test(s) failed, but within acceptable threshold (<=5)"
117+
else
118+
echo "SUCCESS: All ${total} tests passed!"
119+
fi

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

2-
3-
eest_blockchain_tests:
2+
eest_blockchain_tests eest-blockchain-tests:
43
cmake -B build/eest -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DTESTS_DIR=third_party/eest-fixtures/blockchain_tests
54
cmake --build build/eest
65
ctest --test-dir build/eest --parallel

0 commit comments

Comments
 (0)