Prevent an infinite loop with afterFlush events #62
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate push | |
on: [pull_request] | |
jobs: | |
install: | |
strategy: | |
matrix: | |
include: | |
- symfony-version: 5.4 | |
php-version: 8.2 | |
- symfony-version: 6.2 | |
php-version: 8.2 | |
- symfony-version: 6.4 | |
php-version: 8.2 | |
- symfony-version: 7 | |
php-version: 8.2 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: vendor/ | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}-${{ matrix.symfony-version }}-${{ matrix.php-version }}-${{ matrix.symfony-version }} | |
restore-keys: | | |
${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}-${{ matrix.symfony-version }}-${{ matrix.php-version }}-${{ matrix.symfony-version }} | |
- name: PHP Setup | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
ini-values: pcov.directory=. | |
coverage: pcov | |
tools: composer | |
- name: Setup flex | |
run: | | |
composer global require --no-progress --no-scripts --no-plugins symfony/flex && composer global config --no-plugins allow-plugins.symfony/flex true | |
- name: Install | |
env: | |
SYMFONY_REQUIRE: ${{ matrix.symfony-version }} | |
run: | | |
composer update --no-interaction --no-scripts --ansi --no-progress --prefer-dist | |
phpstan: | |
strategy: | |
matrix: | |
include: | |
- symfony-version: 6.4 | |
php-version: 8.2 | |
runs-on: ubuntu-latest | |
needs: install | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: vendor/ | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}-${{ matrix.symfony-version }}-${{ matrix.php-version }}-${{ matrix.symfony-version }} | |
restore-keys: | | |
${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}-${{ matrix.symfony-version }}-${{ matrix.php-version }}-${{ matrix.symfony-version }} | |
- name: PHP Setup | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
ini-values: pcov.directory=. | |
coverage: pcov | |
tools: composer | |
- name: PHPStan | |
run: | | |
vendor/bin/phpstan --ansi --no-progress | |
psalm: | |
strategy: | |
matrix: | |
include: | |
- symfony-version: 6.4 | |
php-version: 8.2 | |
runs-on: ubuntu-latest | |
needs: install | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: vendor/ | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}-${{ matrix.symfony-version }}-${{ matrix.php-version }}-${{ matrix.symfony-version }} | |
restore-keys: | | |
${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}-${{ matrix.symfony-version }}-${{ matrix.php-version }}-${{ matrix.symfony-version }} | |
- name: PHP Setup | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
ini-values: pcov.directory=. | |
coverage: pcov | |
tools: composer | |
- name: Psalm | |
run: | | |
vendor/bin/psalm --no-progress | |
php-cs-fixer: | |
strategy: | |
matrix: | |
include: | |
- symfony-version: 6.4 | |
php-version: 8.2 | |
runs-on: ubuntu-latest | |
needs: install | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: vendor/ | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}-${{ matrix.symfony-version }}-${{ matrix.php-version }}-${{ matrix.symfony-version }} | |
restore-keys: | | |
${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}-${{ matrix.symfony-version }}-${{ matrix.php-version }}-${{ matrix.symfony-version }} | |
- name: PHP Setup | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
ini-values: pcov.directory=. | |
coverage: pcov | |
tools: composer | |
- name: PHP-CS-Fixer | |
run: | | |
vendor/bin/php-cs-fixer fix --config ./.php-cs-fixer.dist.php --dry-run --diff --ansi | |
test: | |
concurrency: | |
group: ${{ github.head_ref || github.ref }} | |
strategy: | |
matrix: | |
include: | |
- symfony-version: 5.4 | |
php-version: 8.2 | |
- symfony-version: 6.2 | |
php-version: 8.2 | |
- symfony-version: 6.4 | |
php-version: 8.2 | |
- symfony-version: 7 | |
php-version: 8.2 | |
runs-on: ubuntu-latest | |
needs: | |
- phpstan | |
- php-cs-fixer | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: vendor/ | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}-${{ matrix.symfony-version }}-${{ matrix.php-version }}-${{ matrix.symfony-version }} | |
restore-keys: | | |
${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}-${{ matrix.symfony-version }}-${{ matrix.php-version }}-${{ matrix.symfony-version }} | |
- name: PHP Setup | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
ini-values: pcov.directory=. | |
coverage: pcov | |
tools: composer | |
- name: PHPUnit | |
run: | | |
vendor/bin/phpunit --coverage-cobertura artifacts/code-coverage-cobertura.xml | |
- name: Code Coverage Report | |
uses: irongut/[email protected] | |
with: | |
filename: artifacts/code-coverage-cobertura.xml | |
badge: true | |
fail_below_min: true | |
format: markdown | |
hide_branch_rate: false | |
hide_complexity: true | |
indicators: true | |
output: both | |
thresholds: '65 80' | |
- name: Add Coverage PR Comment | |
uses: marocchino/sticky-pull-request-comment@v2 | |
if: github.event_name == 'pull_request' | |
with: | |
recreate: true | |
path: code-coverage-results.md |