-
-
Notifications
You must be signed in to change notification settings - Fork 154
52 lines (45 loc) · 1.53 KB
/
benchmark.yml
File metadata and controls
52 lines (45 loc) · 1.53 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
name: Benchmark
on:
push:
branches:
- 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"
- 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 "41898282+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
run: vendor/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: Phpactor Benchmarks
tool: customSmallerIsBetter
output-file-path: output.json
gh-pages-branch: gh-pages
benchmark-data-dir-path: dev/bench
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}