Skip to content

Display DSL function usage examples at function doc page #754

Display DSL function usage examples at function doc page

Display DSL function usage examples at function doc page #754

Workflow file for this run

name: Benchmark Suite
on:
pull_request:
paths:
- '.github/workflows/benchmark-baseline.yml'
- '.github/workflows/test-benchmark.yml'
- 'src/adapter/**'
- 'src/core/**'
- 'src/lib/**'
- 'tools/phpbench/composer.lock'
- 'composer.lock'
# See https://stackoverflow.com/a/72408109
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
benchmark:
name: "Benchmark"
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
dependencies:
- "locked"
php-version:
- "8.1"
operating-system:
- "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: none
tools: composer:v2
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
extensions: :psr, bcmath, dom, hash, json, mbstring, xml, xmlwriter, xmlreader, zlib
- name: "Get Composer Cache Directory"
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: "Cache Composer dependencies"
uses: "actions/cache@v4"
with:
path: "${{ steps.composer-cache.outputs.dir }}"
key: "php-${{ matrix.php-version }}-locked-composer-${{ hashFiles('**/composer.lock') }}"
restore-keys: |
php-${{ matrix.php-version }}-locked-composer-
- name: "Install locked dependencies"
run: "composer install --no-interaction --no-progress"
- name: "Download phpbench benchmarks artifact"
uses: dawidd6/action-download-artifact@v6
with:
workflow: benchmark-baseline.yml
name: phpbench-baseline
path: ./var/phpbench/
- name: "Execute benchmarks"
id: init_comment
run: |
{
echo '# Flow PHP - Benchmarks'
echo '<sup><sub>Results of the benchmarks from this PR are compared with the results from 1.x branch.</sub></sup>'
echo ' '
echo '<details><summary>Extractors</summary>'
echo ' '
echo '```shell'
composer test:benchmark:extractor -- --ref=1.x --progress=none
echo '```'
echo ' '
echo '</details>'
echo ' '
echo '<details><summary>Transformers</summary>'
echo ' '
echo '```shell'
composer test:benchmark:transformer -- --ref=1.x --progress=none
echo '```'
echo ' '
echo '</details>'
echo ' '
echo '<details><summary>Loaders</summary>'
echo ' '
echo '```shell'
composer test:benchmark:loader -- --ref=1.x --progress=none
echo '```'
echo ' '
echo '</details>'
echo ' '
echo '<details><summary>Building Blocks</summary>'
echo ' '
echo '```shell'
composer test:benchmark:building_blocks -- --ref=1.x --progress=none
echo '```'
echo ' '
echo '</details>'
echo ' '
} >> "./var/phpbench/summary.txt"
- uses: actions/upload-artifact@v4
with:
name: phpbench
path: ./var/phpbench/summary.txt
overwrite: true
- name: Save PR number
run: echo ${{ github.event.pull_request.number }} > ./pr-id.txt
- name: Upload PR number
uses: actions/upload-artifact@v4
with:
name: pr
path: ./pr-id.txt
overwrite: true
- name: "Set job summary"
run: |
echo "${{ env.COMMENT_CONTENT }}" >> $GITHUB_STEP_SUMMARY