Skip to content

Dogfood the shared PHP-CS-Fixer config in CI #1

Dogfood the shared PHP-CS-Fixer config in CI

Dogfood the shared PHP-CS-Fixer config in CI #1

Workflow file for this run

name: PHP-CS-Fixer
on:
pull_request:
push:
branches:
- "main"
workflow_dispatch:
concurrency:
group: php-cs-fixer-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: 8.4
coverage: none
extensions: mbstring
- name: Get Composer cache directory
id: composer-cache
run: |
echo "composer_dir={$(composer config cache-files-dir)}" >> $GITHUB_OUTPUT
- name: Retrieve Composer‘s cache
uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6
with:
path: ${{ steps.composer-cache.outputs.composer_dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install composer dependencies
run: "composer install --no-interaction --no-progress --no-scripts"
# Dogfood: lint this package with its own shared PHP-CS-Fixer config.
# A hard gate (not auto-fixed) so a renamed/removed rule from a dependency bump fails loudly.
- name: Run PHP-CS-Fixer
run: composer php-cs-fixer:check