Benchmarking #3
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
--- | |
name: Benchmarking | |
on: | |
workflow_dispatch: | |
env: | |
BENCH_VERSION: ${{ vars.BENCH_VERSION || '1.3.1' }} | |
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.5" | |
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/$BENCH_VERSION/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/[email protected] | |
with: | |
name: "PHPBench-Baseline" | |
path: ${{ github.workspace }}/.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.5" | |
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/$BENCH_VERSION/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: ${{ github.workspace }}/.phpbench/ | |
- # https://github.com/phpbench/phpbench | |
name: Benchmark Reports | |
run: | | |
phpbench run tests/Benchmark --tag=${{ matrix.php-version }} --ref="8.2" --report=aggregate --report overview --output=html | |
- # https://github.com/actions/upload-artifact | |
name: Upload PHPBench report | |
uses: actions/[email protected] | |
with: | |
name: "PHPBench-Report" | |
path: ${{ github.workspace }}/.phpbench/html/index.html |