Skip to content

feat: Introduce #[AsFixture] attribute and foundry:load-fixture command #173

feat: Introduce #[AsFixture] attribute and foundry:load-fixture command

feat: Introduce #[AsFixture] attribute and foundry:load-fixture command #173

Workflow file for this run

on:
workflow_dispatch:
pull_request:
name: "Benchmarks"
jobs:
run:
name: "Benchmarks ${{ matrix.database }} - ${{ matrix.with-dama && 'with Dama' || 'without Dama' }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ 8.4 ]
symfony: [ 7.2.* ]
database: [ mysql|mongo ]
with-dama: [ 0 ]
env:
DATABASE_URL: ${{ contains(matrix.database, 'mysql') && 'mysql://root:root@localhost:3306/foundry?serverVersion=5.7.42' || contains(matrix.database, 'pgsql') && 'postgresql://root:root@localhost:5432/foundry?serverVersion=15' || contains(matrix.database, 'sqlite') && 'sqlite:///%kernel.project_dir%/var/data.db' || '' }}
MONGO_URL: ${{ contains(matrix.database, 'mongo') && 'mongodb://127.0.0.1:27017/dbName?compressors=disabled&gssapiServiceName=mongodb' || '' }}
USE_DAMA_DOCTRINE_TEST_BUNDLE: ${{ matrix.with-dama }}
USE_FOUNDRY_PHPUNIT_EXTENSION: 1
PHPUNIT_VERSION: ${{ matrix.phpunit }}
services:
mongo:
image: ${{ contains(matrix.database, 'mongo') && 'mongo:4' || '' }}
ports:
- 27017:27017
steps:
- name: Set up MySQL
if: contains(matrix.database, 'mysql')
run: sudo /etc/init.d/mysql start
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: flex
- name: Checkout
uses: actions/checkout@v4
with:
ref: 2.5.x
fetch-depth: 1
- name: Install dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.deps }}
composer-options: --prefer-dist
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}
- name: Install PHPBench
run: composer bin phpbench install
- name: Run benchmarks baseline
run: |
bin/tools/phpbench/vendor/phpbench/phpbench/bin/phpbench run \
tests/Benchmark \
--report=aggregate \
--tag=2.x \
--iterations=5 \
--progress=plain \
--retry-threshold=10
- name: Clear vendor files
run: |
rm -rf vendor composer.lock
- name: Checkout
uses: actions/checkout@v4
with:
clean: false
fetch-depth: 1
- name: Install dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.deps }}
composer-options: --prefer-dist
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}
- name: Run benchmarks and compare
run: |
bin/tools/phpbench/vendor/phpbench/phpbench/bin/phpbench run \
tests/Benchmark \
--report=aggregate \
--ref=2.x \
--iterations=5 \
--progress=plain \
--retry-threshold=10 \
--assert="mode(variant.time.avg) <= mode(baseline.time.avg) +/- 10%"