Skip to content

Commit 7876576

Browse files
committed
Change CI Perf to run on schedule, no runs on PRs
See #1635 The goal is to collect data for a while. Until we have enough benchmarks, the PR check is not very useful, so it was disabled. We added `--tolerate-failure` to all runs, so this check will never fail because of a missed performance assertion, but it will report it and archive it.
1 parent b603ef7 commit 7876576

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

.github/workflows/ci-perf.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
name: CI - Perf
22

3+
# EXPERIMENTAL: This workflow is running with --tolerate-failure flag for phpbench
4+
# This is to gather data for a future historical interleaving of performance benchmarks.
5+
36
on:
7+
# Run once per day no matter what
8+
schedule:
9+
- cron: '0 0 * * *'
10+
# Run on push to main, so we get a data point every merge
411
push:
5-
paths:
6-
- 'src/**'
7-
- 'tests/**'
8-
- '.github/**'
9-
pull_request:
10-
paths:
11-
- 'src/**'
12-
- 'tests/**'
13-
- '.github/**'
12+
branches:
13+
- main
14+
# Allow manual triggering with rebaseline option
1415
workflow_dispatch:
1516
inputs:
1617
baseline:
@@ -26,10 +27,8 @@ jobs:
2627
name: Benchmarks
2728
runs-on: ubuntu-latest
2829

29-
continue-on-error: true # This job is experimental
3030
permissions:
3131
contents: write
32-
pull-requests: write
3332

3433
steps:
3534
- uses: actions/checkout@v6
@@ -51,13 +50,9 @@ jobs:
5150
if [ -z "$(ls -A .phpbench)" ] || [ "${{ github.event.inputs.baseline || 'latest' }}" = "rebaseline" ]; then
5251
vendor/bin/phpbench run --report=aggregate --progress=plain --store --tag=${GITHUB_SHA}
5352
54-
# On main branch push, update baseline with tolerance for failures.
55-
elif [ "${GITHUB_REF}" = "refs/heads/main" ] && [ "${GITHUB_EVENT_NAME}" = "push" ]; then
53+
# Baseline exists. Compare against it.
54+
else
5655
vendor/bin/phpbench run --report=aggregate --progress=plain --store --tag=${GITHUB_SHA} --ref=latest --tolerate-failure
57-
58-
# On other branches, compare against latest baseline, fails if worse.
59-
else
60-
vendor/bin/phpbench run --report=aggregate --progress=plain --store --tag=${GITHUB_SHA} --ref=latest
6156
fi
6257
6358
# Generate report for human consumption
@@ -67,7 +62,11 @@ jobs:
6762
cat report.md
6863
6964
- name: Commit Results
70-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
65+
# only on: main push, schedule, workflow_dispatch+rebaseline
66+
if: >-
67+
(github.ref == 'refs/heads/main' && github.event_name == 'push') ||
68+
(github.event_name == 'schedule') ||
69+
(github.event_name == 'workflow_dispatch' && github.event.inputs.baseline == 'rebaseline')
7170
run: |
7271
set -euo pipefail
7372
git config user.name "github-actions[bot]"

0 commit comments

Comments
 (0)