GitHub Actions support for Blackfire

By Jérôme Vieilledent, on Aug 24, 2020

Nowadays, GitHub Actions is a major player in the CI/CD world. It perfectly integrates with GitHub ecosystem and makes it easy to define a workflow for testing, building, and deploying your applications.

In this context, we are thrilled to announce the support of GitHub Actions support for Blackfire, for all supported languages (PHP, Python and Go). This was made possible thanks to the great work of Shivam Mathur on the setup-php action.

Here is a quick example of Blackfire usage with GitHub Actions:

    runs-on: ubuntu-latest

    - uses: actions/checkout@v2

    - name: Setup Blackfire via setup-php Action
      uses: shivammathur/setup-php@v2
        # PHP Only: Setup PHP extensions, including Blackfire Probe.
        # It is recommended to disable xdebug.
        # Not needed for other languages.
        extensions: blackfire, :xdebug
        # Setup Blackfire Agent and CLI tool + Blackfire Player
        tools: blackfire, blackfire-player
        # Expose your Blackfire credentials stored in secrets
        # as environment variables.

    # Trigger a profile using Blackfire CLI tool.
    - name: Profile a command
        APP_ENV: prod
        APP_DEBUG: 0
      run: blackfire run php bin/console app:list-users
      # Other example using Python:
      #run: blackfire run python

But this action is designed for PHP! You said that Blackfire integrates with GitHub actions for all supported languages 🤔.

It is indeed correct that the setup-php action is designed for PHP apps. However, all Blackfire components are made available by this action, including Blackfire agent, blackfire CLI tool and blackfire-player (which requires PHP). This makes it possible to use Blackfire with other languages such as Python or Go.

You can now enjoy the simplicity of GitHub Actions together with the power of profiling with Blackfire!

Happy profiling!

Jérôme Vieilledent

As a Developer Advocate, Jérôme is all about spreading the love! His technical/development background enable him to talk as a peer to peers with our developer users. You’ll read his tips and advices on performance management with Blackfire. And he’ll support you as a day-to-day user.