Skip to content

Commit 75eae8b

Browse files
committed
Only save benchmark data from master builds as new baseline
1 parent 66daccb commit 75eae8b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/ci.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -328,14 +328,14 @@ jobs:
328328
if: matrix.benchmarks
329329
run: ./_build/install/default/bin/syntax_benchmarks | tee tests/benchmark-output.json
330330

331-
- name: Download previous benchmark data
331+
- name: Restore previous benchmark data
332332
if: matrix.benchmarks
333-
uses: actions/cache@v4
333+
uses: actions/cache/restore@v4
334334
with:
335335
path: ./tests/benchmark-cache
336336
key: syntax-benchmark-v1
337337

338-
- name: Store benchmark result
338+
- name: Create new benchmark data and comment on alert
339339
# Do not run for PRs created from other repos as those won't be able to write to the pull request
340340
if: ${{ matrix.benchmarks && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.repository.full_name) }}
341341
uses: benchmark-action/github-action-benchmark@v1
@@ -349,6 +349,13 @@ jobs:
349349
comment-always: true
350350
comment-on-alert: true
351351

352+
- name: Save benchmark data as new baseline
353+
if: matrix.benchmarks && github.ref == 'refs/heads/master'
354+
uses: actions/cache/save@v4
355+
with:
356+
path: ./tests/benchmark-cache
357+
key: syntax-benchmark-v1
358+
352359
- name: Build playground compiler
353360
if: matrix.build_playground
354361
run: |

0 commit comments

Comments
 (0)