Skip to content

Commit 731e3a2

Browse files
committed
✨ benchmark runner
1 parent 08ccffd commit 731e3a2

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/benchmark.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# we're running the benchmarks in a job separate from CI as it may take some time to finish
2+
3+
on:
4+
push:
5+
branches:
6+
- benchmark-runner
7+
8+
name: "Benchmark"
9+
10+
env:
11+
PHP_EXTENSIONS: fileinfo, gd, imagick, json, mbstring
12+
PHP_INI_VALUES: memory_limit=-1, error_reporting=-1, display_errors=On
13+
14+
jobs:
15+
16+
benchmark:
17+
name: "Run Benchmark suite"
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: "Checkout sources"
22+
uses: actions/checkout@v4
23+
with:
24+
ref: main
25+
26+
- name: "Install PHP"
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: "8.3"
30+
extensions: opcache, ${{ env.PHP_EXTENSIONS }}
31+
ini-values: ${{ env.PHP_INI_VALUES }}
32+
coverage: none
33+
34+
- name: "Install dependencies with composer"
35+
uses: ramsey/composer-install@v3
36+
with:
37+
working-directory: main
38+
39+
- name: "Run PHPBench"
40+
run: php main/vendor/bin/phpbench run --progress=plain --report=bare --output=csv
41+
42+
- name: "Parse benchmark results"
43+
run: php main/benchmark/parse-result.php
44+
45+
- name: "Generate HTML report"
46+
run: php main/benchmark/generate-html.php
47+
48+
- name: "Generate Markdown report"
49+
run: php main/benchmark/generate-markdown.php
50+
51+
- name: "Publish results to branch benchmark"
52+
uses: JamesIves/github-pages-deploy-action@v4
53+
with:
54+
branch: benchmark
55+
folder: main/.build/phpbench
56+
clean: true

0 commit comments

Comments
 (0)