-
-
Notifications
You must be signed in to change notification settings - Fork 89
125 lines (100 loc) · 3.37 KB
/
benchmark.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
---
name: Benchmarking
on:
workflow_dispatch:
jobs:
benchmark-baseline:
name: "Benchmark Baseline"
runs-on: "${{ matrix.operating-system }}"
strategy:
fail-fast: false
matrix:
operating-system:
- "ubuntu-22.04"
php-version:
- "8.2"
steps:
- # https://github.com/actions/checkout
name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "9.2"
repository: "overtrue/phplint"
- # https://github.com/shivammathur/setup-php
name: Setup PHP runtime
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
coverage: "none"
- # https://github.com/ramsey/composer-install
name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
composer-options: "--prefer-dist"
- # https://github.com/phpbench/phpbench
name: Install PHPBench
run: |
curl -Ls https://github.com/phpbench/phpbench/releases/download/1.2.15/phpbench.phar -o /usr/local/bin/phpbench
chmod +x /usr/local/bin/phpbench
- # https://github.com/phpbench/phpbench
name: Benchmark baseline
run: |
phpbench run tests/Benchmark --tag=${{ matrix.php-version }}
- # https://github.com/actions/upload-artifact
name: Upload PHPBench baseline
uses: actions/upload-artifact@v3
with:
name: "PHPBench-Baseline"
path: ".phpbench/"
benchmark-report:
needs: benchmark-baseline
name: "Benchmark Report"
runs-on: "${{ matrix.operating-system }}"
strategy:
fail-fast: false
matrix:
operating-system:
- "ubuntu-22.04"
php-version:
- "8.3"
steps:
- # https://github.com/actions/checkout
name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "9.2"
repository: "overtrue/phplint"
- # https://github.com/shivammathur/setup-php
name: Setup PHP runtime
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
coverage: "none"
- # https://github.com/ramsey/composer-install
name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
composer-options: "--prefer-dist"
- # https://github.com/phpbench/phpbench
name: Install PHPBench
run: |
curl -Ls https://github.com/phpbench/phpbench/releases/download/1.2.15/phpbench.phar -o /usr/local/bin/phpbench
chmod +x /usr/local/bin/phpbench
- # https://github.com/actions/download-artifact
name: Retrieve PHPBench baseline results
uses: actions/[email protected]
with:
name: "PHPBench-Baseline"
path: ".phpbench/"
- # https://github.com/phpbench/phpbench
name: Benchmark Reports
run: |
phpbench run tests/Benchmark --tag=${{ matrix.php-version }} --ref="8.1" --report=aggregate --report overview --output=html
- # https://github.com/actions/upload-artifact
name: Upload PHPBench report
uses: actions/upload-artifact@v3
with:
name: "PHPBench-Report"
path: ".phpbench/html/index.html"