ci(bench): build baseline and feature binaries in parallel (#22323)

This commit is contained in:
Alexey Shekhirin
2026-02-18 14:30:58 +00:00
committed by GitHub
parent 302993b45a
commit 9251997c1f
2 changed files with 48 additions and 35 deletions

View File

@@ -403,7 +403,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: parseInt(process.env.BENCH_COMMENT_ID),
body: buildBody('Building baseline binary...'),
body: buildBody('Building binaries...'),
});
- uses: dtolnay/rust-toolchain@stable
@@ -474,21 +474,34 @@ jobs:
echo "feature-ref=$FEATURE_REF" >> "$GITHUB_OUTPUT"
echo "feature-name=$FEATURE_NAME" >> "$GITHUB_OUTPUT"
- name: Fetch or build baseline binaries
id: build-baseline
run: .github/scripts/bench-reth-build.sh baseline "${{ steps.refs.outputs.baseline-ref }}"
- name: Prepare source dirs
run: |
if [ -d ../reth-baseline ]; then
git -C ../reth-baseline fetch origin
else
git clone . ../reth-baseline
fi
git -C ../reth-baseline checkout "${{ steps.refs.outputs.baseline-ref }}"
ln -sfn "$(pwd)" ../reth-feature
- name: Update status (baseline built)
if: success() && env.BENCH_COMMENT_ID
uses: actions/github-script@v7
with:
script: |
const s = require('./.github/scripts/bench-update-status.js');
await s({github, context, status: 'Building feature binary...'});
- name: Build baseline and feature binaries in parallel
id: build
run: |
BASELINE_DIR="$(cd ../reth-baseline && pwd)"
FEATURE_DIR="$(cd ../reth-feature && pwd)"
- name: Fetch or build feature binaries
id: build-feature
run: .github/scripts/bench-reth-build.sh feature "${{ steps.refs.outputs.feature-ref }}"
.github/scripts/bench-reth-build.sh baseline "${BASELINE_DIR}" "${{ steps.refs.outputs.baseline-ref }}" &
PID_BASELINE=$!
.github/scripts/bench-reth-build.sh feature "${FEATURE_DIR}" "${{ steps.refs.outputs.feature-ref }}" &
PID_FEATURE=$!
FAIL=0
wait $PID_BASELINE || FAIL=1
wait $PID_FEATURE || FAIL=1
if [ $FAIL -ne 0 ]; then
echo "::error::One or both builds failed"
exit 1
fi
# System tuning for reproducible benchmarks
- name: System setup
@@ -545,7 +558,7 @@ jobs:
- name: "Run benchmark: baseline"
id: run-baseline
run: taskset -c 0 .github/scripts/bench-reth-run.sh baseline target/profiling-baseline/reth /tmp/bench-results-baseline
run: taskset -c 0 .github/scripts/bench-reth-run.sh baseline ../reth-baseline/target/profiling/reth /tmp/bench-results-baseline
- name: Update status (running feature benchmark)
if: success() && env.BENCH_COMMENT_ID
@@ -557,7 +570,7 @@ jobs:
- name: "Run benchmark: feature"
id: run-feature
run: taskset -c 0 .github/scripts/bench-reth-run.sh feature target/profiling/reth /tmp/bench-results-feature
run: taskset -c 0 .github/scripts/bench-reth-run.sh feature ../reth-feature/target/profiling/reth /tmp/bench-results-feature
# Results & charts
- name: Parse results
@@ -695,8 +708,7 @@ jobs:
with:
script: |
const steps_status = [
['building baseline binary', '${{ steps.build-baseline.outcome }}'],
['building feature binary', '${{ steps.build-feature.outcome }}'],
['building binaries', '${{ steps.build.outcome }}'],
['running baseline benchmark', '${{ steps.run-baseline.outcome }}'],
['running feature benchmark', '${{ steps.run-feature.outcome }}'],
];