@@ -195,6 +195,10 @@ jobs:
195
195
matrix :
196
196
ghc : ["8.10.7", "9.6.6", "9.10.1"]
197
197
198
+ env :
199
+ ACCEPT_BENCHMARKS : ${{ contains(github.event.pull_request.labels.*.name, 'acceptable benchmarks') }}
200
+ BENCH_OPTIONS : " "
201
+
198
202
steps :
199
203
- uses : actions/checkout@v4
200
204
@@ -230,6 +234,13 @@ jobs:
230
234
if : github.event_name == 'push' && github.ref == 'refs/heads/main'
231
235
run : cp mempool-benchmarks.csv baseline-mempool-benchmarks.csv
232
236
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
+
233
244
# TODO: this will be necessary when we publish the benchmarks results.
234
245
# - name: Upload mempool benchmark baseline results
235
246
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
@@ -238,15 +249,13 @@ jobs:
238
249
# name: baseline-mempool-benchmarks
239
250
# path: baseline-mempool-benchmarks.csv
240
251
241
- # The `fail-if-slower` value is determined ad-hoc based on the variability
242
- # we observed in our benchmarks.
243
252
- name : Run mempool benchmarks on pull requests
244
253
if : ${{ github.event_name == 'pull_request' }}
245
254
run : |
246
255
if [ -f baseline-mempool-benchmarks.csv ]; then
247
256
./mempool-bench \
248
257
--timeout=60 --baseline baseline-mempool-benchmarks.csv \
249
- --fail-if-slower 100 \
258
+ ${{ env.BENCH_OPTIONS }} \
250
259
+RTS -T
251
260
else
252
261
echo "No baseline benchmarks found. This likely happened when adding a new GHC version to the build matrix."
0 commit comments