Add example

This commit is contained in:
Jaapio 2020-02-27 10:57:09 +01:00
parent 3dfd7a648b
commit 311eb9f3ba
No known key found for this signature in database
GPG Key ID: 23037689C7B51CB9
2 changed files with 35 additions and 0 deletions

View File

@ -107,6 +107,8 @@ with:
extensions: xdebug-beta
```
- Blackfire PHP extension is available for install.
- Extensions which cannot be installed gracefully leave an error message in the logs, the action is not interrupted.
## :wrench: Tools Support
@ -489,6 +491,7 @@ Examples for setting up this GitHub Action with different PHP Frameworks/Package
|Yii2 Starter Kit with `MySQL`|`ubuntu`|[yii2-mysql.yml](./examples/yii2-mysql.yml "GitHub Action for Yii2 Starter Kit with MySQL")|
|Yii2 Starter Kit with `PostgreSQL`|`ubuntu`|[yii2-postgres.yml](./examples/yii2-postgres.yml "GitHub Action for Yii2 Starter Kit with PostgreSQL")|
|Zend Framework|`macOS`, `ubuntu` and `windows`|[zend-framework.yml](./examples/zend-framework.yml "GitHub Action for Zend Framework")|
|Blackfire|`macOS`, `ubuntu` and `windows`|[blackfire.yml](./examples/blackfire.yml "GitHub Action using blackfire")|
## :scroll: License

32
examples/blackfire.yml Normal file
View File

@ -0,0 +1,32 @@
# GitHub Action for blackfire
name: Profiling with blackfire
on: [push, pull_request]
jobs:
bedrock:
name: Blackfire (PHP ${{ matrix.php-versions }})
runs-on: ${{ matrix.operating-system }}
services:
blackfire:
image: blackfire/blackfire
ports:
- 8707:8707
env:
BLACKFIRE_SERVER_ID: "<id>"
BLACKFIRE_SERVER_TOKEN: "<token>"
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['7.1', '7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: blackfire-1.30.0
ini-values: blackfire.agent_socket=tcp://localhost:8707
- name: Profile
# Note that blackfire agent is not installed. So an implementation with the sdk is required!
run: php your-blackfire-sdk-script.php