Skip to content

Commit

Permalink
ci: Add PHPBench reporting.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jan 4, 2022
1 parent 02198fc commit 8c2d6c7
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

on:
pull_request:

name: "Benchmarks"

jobs:
run:
name: "Benchmarks"
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ["8.1"]

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Install PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php-versions }}
coverage: none

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

- name: Cache dependencies
uses: actions/[email protected]
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Checkout
uses: actions/[email protected]
with:
ref: main
fetch-depth: 1

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

- name: Install dependencies required for benchmarks
run: make install-benchmarks

- name: Run benchmarks
run: "vendor/bin/phpbench run --php-config='opcache.enable_cli: true' tests/benchmarks --report=test --tag=main"

- name: Clear vendor files
run: |
rm -rf vendor composer.lock
- name: Checkout
uses: actions/[email protected]
with:
clean: false
fetch-depth: 1

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

- name: Install dependencies required for benchmarks
run: make install-benchmarks

- name: Run benchmarks
run: "vendor/bin/phpbench run --php-config='opcache.enable_cli: true' tests/benchmarks --report=test --ref=main"

0 comments on commit 8c2d6c7

Please sign in to comment.