-
-
Notifications
You must be signed in to change notification settings - Fork 47
59 lines (49 loc) · 2.01 KB
/
benchmark.yml
File metadata and controls
59 lines (49 loc) · 2.01 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
57
58
59
name: Benchmark
on:
pull_request:
branches: [main]
concurrency:
group: benchmark-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
benchmark:
name: Performance Regression Check
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none
- name: Install dependencies
uses: ramsey/composer-install@v3
- name: Benchmark base branch
run: |
git checkout ${{ github.event.pull_request.base.sha }}
composer install --no-interaction --prefer-dist --quiet
vendor/bin/phpbench run --tag=base --store --progress=none
- name: Benchmark PR branch
run: |
git checkout ${{ github.event.pull_request.head.sha }}
composer install --no-interaction --prefer-dist --quiet
vendor/bin/phpbench run --tag=pr --store --ref=base --report=aggregate --progress=none --output=markdown | tee benchmark-result.txt || true
- name: Prepare artifact
run: |
mkdir -p benchmark-artifact
cp benchmark-result.txt benchmark-artifact/
echo "${{ github.event.pull_request.number }}" > benchmark-artifact/pr-number.txt
echo "${{ github.head_ref }}" > benchmark-artifact/head-ref.txt
echo "${{ github.base_ref }}" > benchmark-artifact/base-ref.txt
echo "${{ github.event.pull_request.base.sha }}" > benchmark-artifact/base-sha.txt
echo "${{ github.event.pull_request.head.sha }}" > benchmark-artifact/head-sha.txt
- name: Upload benchmark artifact
uses: actions/upload-artifact@v6
with:
name: benchmark-result
path: benchmark-artifact/
retention-days: 1