Skip to content

Commit ee30b3d

Browse files
[ci] Add benchmark dry run mode
1 parent d5b4c8c commit ee30b3d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: Benchmark
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
publish:
7+
description: "Publish results to the benchmarks repository"
8+
required: false
9+
default: false
10+
type: boolean
511
schedule:
612
- cron: '0 10 * * *' # Run at 10:00 UTC every day
713

@@ -19,6 +25,7 @@ jobs:
1925
fetch-depth: 1
2026

2127
- name: Exit early if no new commits
28+
if: github.event_name == 'schedule'
2229
id: check-commits
2330
run: |
2431
count=$(git log --oneline --since '24 hours ago' | wc -l)
@@ -106,7 +113,13 @@ jobs:
106113
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
107114
with:
108115
name: benchmark-${{ matrix.benchmark_name }}
116+
- name: Validate benchmark result
117+
run: |
118+
output="${{ matrix.benchmark_name }}.txt"
119+
test -s "$output"
120+
grep -Eq '^test .+ \.\.\. bench:' "$output"
109121
- name: Publish benchmark result
122+
if: github.event_name == 'schedule' || inputs.publish
110123
uses: benchmark-action/github-action-benchmark@4bdcce38c94cec68da58d012ac24b7b1155efe8b # v1.20.7
111124
with:
112125
name: ${{ matrix.benchmark_name }}

0 commit comments

Comments
 (0)