-
-
Notifications
You must be signed in to change notification settings - Fork 132
57 lines (49 loc) · 1.75 KB
/
benchmark.yml
File metadata and controls
57 lines (49 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Benchmark
on:
push:
branches:
# change this to your main branch
- master
jobs:
benchmark:
name: Benchmark
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: "8.2"
tools: composer:v2
- name: Composer install
uses: ramsey/composer-install@v2
with:
composer-options: "--no-scripts"
# optionally ensure that the gh-pages branch exists. feel free to create
# this yourself and ommit this step.
- name: Ensure gh-pages branch exists
run: |
if ! git ls-remote --exit-code --heads origin gh-pages > /dev/null 2>&1; then
git config user.name "github-actions[bot]"
git config user.email "12345678+github-actions[bot]@users.noreply.github.com"
empty_tree="$(git hash-object -t tree /dev/null)"
commit="$(git commit-tree "$empty_tree" -m 'Initial gh-pages branch')"
git push origin "$commit:refs/heads/gh-pages"
fi
- name: Run PHPBench
# you probably need to change this to vendor/bin/phpbench
run: bin/phpbench run --progress=plain --report=github-action-benchmark --output=json > output.json
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: PHPBench Performance
tool: customSmallerIsBetter
output-file-path: output.json
gh-pages-branch: gh-pages
benchmark-data-dir-path: benchmarks
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}