Skip to content

Commit 4b32aa0

Browse files
committed
WIP: accept benchmark result based on a PR label
1 parent 2887989 commit 4b32aa0

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/ci.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ jobs:
195195
matrix:
196196
ghc: ["8.10.7", "9.6.6", "9.10.1"]
197197

198+
env:
199+
ACCEPT_BENCHMARKS: ${{ contains(github.event.pull_request.labels.*.name, 'acceptable benchmarks') }}
200+
BENCH_OPTIONS: ""
201+
198202
steps:
199203
- uses: actions/checkout@v4
200204

@@ -230,6 +234,13 @@ jobs:
230234
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
231235
run: cp mempool-benchmarks.csv baseline-mempool-benchmarks.csv
232236

237+
# The `fail-if-slower` value is determined ad-hoc based on the variability
238+
# we observed in our benchmarks.
239+
- name: Set benchmark options (accept)
240+
if: ${{ !env.ACCEPT_BENCHMARKS }}
241+
run: |
242+
echo "BENCH_OPTIONS='--fail-if-slower 100'" >> "GITHUB_ENV"
243+
233244
# TODO: this will be necessary when we publish the benchmarks results.
234245
# - name: Upload mempool benchmark baseline results
235246
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
@@ -238,15 +249,13 @@ jobs:
238249
# name: baseline-mempool-benchmarks
239250
# path: baseline-mempool-benchmarks.csv
240251

241-
# The `fail-if-slower` value is determined ad-hoc based on the variability
242-
# we observed in our benchmarks.
243252
- name: Run mempool benchmarks on pull requests
244253
if: ${{ github.event_name == 'pull_request' }}
245254
run: |
246255
if [ -f baseline-mempool-benchmarks.csv ]; then
247256
./mempool-bench \
248257
--timeout=60 --baseline baseline-mempool-benchmarks.csv \
249-
--fail-if-slower 100 \
258+
${{ env.BENCH_OPTIONS }} \
250259
+RTS -T
251260
else
252261
echo "No baseline benchmarks found. This likely happened when adding a new GHC version to the build matrix."

0 commit comments

Comments
 (0)