-
-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new benchmark GitHub Workflows to compare performance between PHP…
… 8.1 and 8.3
- Loading branch information
Showing
1 changed file
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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.1" | ||
|
||
steps: | ||
- # https://github.com/actions/checkout | ||
name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: "9.1" | ||
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/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.1" | ||
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/download-artifact@v3 | ||
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" |