|
1 | 1 | name: CI - Perf |
2 | 2 |
|
| 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 | + |
3 | 6 | 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 |
4 | 11 | 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 |
14 | 15 | workflow_dispatch: |
15 | 16 | inputs: |
16 | 17 | baseline: |
|
26 | 27 | name: Benchmarks |
27 | 28 | runs-on: ubuntu-latest |
28 | 29 |
|
29 | | - continue-on-error: true # This job is experimental |
30 | 30 | permissions: |
31 | 31 | contents: write |
32 | | - pull-requests: write |
33 | 32 |
|
34 | 33 | steps: |
35 | 34 | - uses: actions/checkout@v6 |
|
51 | 50 | if [ -z "$(ls -A .phpbench)" ] || [ "${{ github.event.inputs.baseline || 'latest' }}" = "rebaseline" ]; then |
52 | 51 | vendor/bin/phpbench run --report=aggregate --progress=plain --store --tag=${GITHUB_SHA} |
53 | 52 |
|
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 |
56 | 55 | 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 |
61 | 56 | fi |
62 | 57 | |
63 | 58 | # Generate report for human consumption |
|
67 | 62 | cat report.md |
68 | 63 |
|
69 | 64 | - 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') |
71 | 70 | run: | |
72 | 71 | set -euo pipefail |
73 | 72 | git config user.name "github-actions[bot]" |
|
0 commit comments