Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Php bench performance in CI #2893

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
31 changes: 31 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,37 @@ jobs:
- name: Static analysis with PHPStan
run: ./vendor/bin/phpstan analyse

performance:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
coverage: none
tools: cs2pr

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Performance tests with PHPBench
run: ./vendor/bin/phpbench run tests/Performance --report=aggregate

coverage:
runs-on: ubuntu-latest
steps:
Expand Down
17 changes: 11 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
],
"versions": [
"phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PHPCompatibility --runtime-set testVersion 7.4- -n"
],
"bench": [
"phpbench run tests/Performance/ --report=aggregate -n"
]
},
"require": {
Expand Down Expand Up @@ -79,14 +82,15 @@
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"dompdf/dompdf": "^1.0 || ^2.0",
"friendsofphp/php-cs-fixer": "^3.2",
"dompdf/dompdf": "^2.0",
"friendsofphp/php-cs-fixer": "^3.13",
"mitoteam/jpgraph": "^10.2.4",
"mpdf/mpdf": "^8.1.1",
"mpdf/mpdf": "^8.1.2",
"phpbench/phpbench": "^1.2",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/phpstan": "^1.1",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^8.5 || ^9.0",
"phpstan/phpstan": "^1.9",
"phpstan/phpstan-phpunit": "^1.2",
"phpunit/phpunit": "^9.0",
"squizlabs/php_codesniffer": "^3.7",
"tecnickcom/tcpdf": "^6.5"
},
Expand All @@ -105,6 +109,7 @@
"autoload-dev": {
"psr-4": {
"PhpOffice\\PhpSpreadsheetTests\\": "tests/PhpSpreadsheetTests",
"PhpOffice\\PhpSpreadsheetPerformance\\": "tests/Performance",
"PhpOffice\\PhpSpreadsheetInfra\\": "infra"
}
}
Expand Down
Loading