-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (106 loc) · 3.6 KB
/
eest-blockchain-tests.yml
File metadata and controls
119 lines (106 loc) · 3.6 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
name: EEST Blockchain Tests
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
workflow_dispatch:
jobs:
eest-blockchain-tests:
name: Run EEST Blockchain Tests
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 \
g++-15 \
cmake \
ninja-build \
git \
git-lfs \
python3 \
python3-pip \
pipx
pipx install conan
pipx ensurepath
- name: Verify tool versions
run: |
gcc --version
g++ --version
cmake --version
ninja --version
git --version
git lfs version
python3 --version
ctest --version
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
lfs: true
- name: Run EEST blockchain tests
id: run_tests
shell: bash
run: |
set +e
make eest-blockchain-tests 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
run: |
echo "========================================"
echo " EEST TEST SUMMARY"
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: |
output.log
build/eest/Testing/Temporary/LastTest.log
retention-days: 30
- name: Check failure threshold
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