2020-02-28 15:42:17 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# GitHub Action for Blackfire
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-27 10:57:09 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								name: Profiling with blackfire
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								on: [push, pull_request]
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								jobs:
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-28 15:42:17 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  blackfire:
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-27 10:57:09 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    name: Blackfire (PHP ${{ matrix.php-versions }})
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-28 15:42:17 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    # Add your Blackfire credentials securely using GitHub Secrets
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    env:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      BLACKFIRE_SERVER_ID: ${{ secrets.BLACKFIRE_SERVER_ID }}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      BLACKFIRE_SERVER_TOKEN: ${{ secrets.BLACKFIRE_SERVER_TOKEN }}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      BLACKFIRE_CLIENT_ID: ${{ secrets.BLACKFIRE_CLIENT_ID }}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      BLACKFIRE_CLIENT_TOKEN: ${{ secrets.BLACKFIRE_CLIENT_TOKEN }}
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-27 10:57:09 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    runs-on: ${{ matrix.operating-system }}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    strategy:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      fail-fast: false
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      matrix:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        operating-system: [ubuntu-latest, windows-latest, macos-latest]
							 | 
						
					
						
							
								
									
										
										
										
											2021-12-15 16:49:10 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        php-versions: ['7.4', '8.0', '8.1']
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        # Blackfire supports PHP >= 5.3 on Ubuntu and macOS, and PHP >= 5.4 on Windows
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-27 10:57:09 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    steps:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      - name: Checkout
							 | 
						
					
						
							
								
									
										
										
										
											2025-10-12 11:05:16 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        uses: actions/checkout@v5
							 | 
						
					
						
							
								
									
										
										
										
											2021-12-15 16:49:10 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      # Docs: https://github.com/shivammathur/setup-php
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      - name: Setup PHP
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        uses: shivammathur/setup-php@v2
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-27 10:57:09 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        with:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								          php-version: ${{ matrix.php-versions }}
							 | 
						
					
						
							
								
									
										
										
										
											2021-12-15 16:49:10 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								          # Setup Blackfire extension and CLI
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-28 15:42:17 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								          extensions: blackfire
							 | 
						
					
						
							
								
									
										
										
										
											2021-12-15 16:49:10 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								          tools: blackfire
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								          # Disable Xdebug and PCOV coverage drivers
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-28 15:42:17 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								          coverage: none
							 | 
						
					
						
							
								
									
										
										
										
											2021-12-15 16:49:10 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      # Refer to https://blackfire.io/docs/cookbooks/profiling-cli
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-27 10:57:09 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      - name: Profile
							 | 
						
					
						
							
								
									
										
										
										
											2021-12-15 16:49:10 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        run: blackfire run php my-script.php
							 |