Skip to content

chore(deps): bump friendsofphp/php-cs-fixer from 3.95.18 to 3.95.20 (… #105

chore(deps): bump friendsofphp/php-cs-fixer from 3.95.18 to 3.95.20 (…

chore(deps): bump friendsofphp/php-cs-fixer from 3.95.18 to 3.95.20 (… #105

Workflow file for this run

# CI: tests on PHP 8.2–8.5 × Symfony 7.4, 8.0, 8.1 (Symfony 8 requires PHP 8.4+).
# Coverage with PCOV; release updated via release.yml on tag push.
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
git-hygiene:
name: Git history (no Cursor co-author)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Check for Cursor co-author trailers (REQ-GIT-001)
run: |
chmod +x .scripts/check-no-cursor-coauthor.sh
./.scripts/check-no-cursor-coauthor.sh HEAD
test:
name: PHP ${{ matrix.php }} - Symfony ${{ matrix.symfony }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4', '8.5']
symfony: ['7.4', '8.0', '8.1']
exclude:
- php: '8.2'
symfony: '8.0'
- php: '8.2'
symfony: '8.1'
- php: '8.3'
symfony: '8.0'
- php: '8.3'
symfony: '8.1'
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json
coverage: pcov
tools: composer:v2
- name: Validate composer.json
run: composer validate --strict
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v6
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-
${{ runner.os }}-php-${{ matrix.php }}-composer-
- name: Install dependencies with Symfony ${{ matrix.symfony }}
run: |
composer require symfony/config:^${{ matrix.symfony }} symfony/console:^${{ matrix.symfony }} symfony/dependency-injection:^${{ matrix.symfony }} symfony/http-kernel:^${{ matrix.symfony }} symfony/http-foundation:^${{ matrix.symfony }} symfony/routing:^${{ matrix.symfony }} symfony/web-profiler-bundle:^${{ matrix.symfony }} --no-interaction --no-update
composer update symfony/* --with-all-dependencies --no-interaction --prefer-dist --no-progress
- name: Composer audit (Critical/High)
run: composer audit --locked
- name: Run tests
env:
SYMFONY_DEPRECATIONS_HELPER: max[direct]=0
run: |
echo "🧪 Running tests on PHP ${{ matrix.php }} with Symfony ${{ matrix.symfony }}..."
composer test
if [ $? -ne 0 ]; then
echo "❌ ERROR: Some tests failed"
exit 1
fi
echo "✅ All tests passed successfully"
- name: Run tests with coverage (PHP 8.2 + Symfony 7.4 only)
if: matrix.php == '8.2' && matrix.symfony == '7.4'
env:
SYMFONY_DEPRECATIONS_HELPER: max[direct]=0
run: |
echo "📊 Generating coverage report..."
composer test-coverage
if [ $? -ne 0 ]; then
echo "❌ ERROR: Tests failed when generating coverage"
exit 1
fi
echo "✅ Coverage generated"
code-style:
name: Code Style
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:v2, cs2pr
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction
- name: Fix code style
run: composer cs-fix
- name: Check for changes
id: verify-changed-files
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Commit changes
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "Apply PHP CS Fixer fixes [skip ci]"
git push
code-style-check:
name: Code Style Check
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:v2, cs2pr
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction
- name: Check code style
run: composer cs-check
coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: json
coverage: pcov
tools: composer:v2
- name: Install dependencies (Symfony 7.4)
run: |
composer require symfony/config:^7.4 symfony/dependency-injection:^7.4 symfony/http-kernel:^7.4 symfony/http-foundation:^7.4 symfony/routing:^7.4 symfony/web-profiler-bundle:^7.4 --no-interaction --no-update
composer update symfony/* --with-all-dependencies --no-interaction --prefer-dist --no-progress
- name: Run tests with coverage
env:
SYMFONY_DEPRECATIONS_HELPER: max[direct]=0
run: |
echo "🧪 Running tests with coverage..."
rm -rf .phpunit.cache
composer test-coverage
if [ $? -ne 0 ]; then
echo "❌ ERROR: Tests failed"
exit 1
fi
echo "✅ All tests passed successfully"
- name: Validate coverage file
run: |
if [ ! -f coverage.xml ]; then
echo "ERROR: coverage.xml was not generated"
exit 1
fi
echo "✅ coverage.xml generated"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
files: coverage.xml
fail_ci_if_error: false
# Maintainer: Héctor Franco Aceituno (@HecFranco)
# Organization: nowo-tech (https://github.com/nowo-tech)