-
Notifications
You must be signed in to change notification settings - Fork 132
79 lines (68 loc) · 2.32 KB
/
benchmark.yml
File metadata and controls
79 lines (68 loc) · 2.32 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
name: Performance Benchmarks
on:
pull_request:
paths:
- 'crates/bench/**'
- 'crates/core/**'
- 'crates/types/**'
- '.github/workflows/benchmark.yml'
push:
branches:
- main
workflow_dispatch:
jobs:
benchmark:
name: Run Transaction Ingestion Benchmarks
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Install gnuplot
run: sudo apt-get update && sudo apt-get install -y gnuplot
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache Cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache build artifacts
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
- name: Run benchmarks
run: cargo bench --bench transaction_ingestion -p surfpool-bench 2>&1 | tee benchmark.log
- name: Extract benchmark results
run: |
echo "## Benchmark Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Transaction Component Performance" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if grep -q "time:" benchmark.log; then
echo '```' >> $GITHUB_STEP_SUMMARY
grep -E "(Benchmarking|time:|change:|No change)" benchmark.log >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
else
echo "Benchmark data not captured" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "Detailed HTML reports available in artifacts." >> $GITHUB_STEP_SUMMARY
- name: Upload benchmark results
if: always()
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: target/criterion
if-no-files-found: ignore