Skip to content

Commit

Permalink
fix(workflows): update php-cs-fixer workflow
Browse files Browse the repository at this point in the history
- Update php-cs-fixer.yml file in workflows
- Modify the workflow to run on push events only
- Remove unused steps
- Cache composer dependencies
- Run composer install
- Run php-cs-fixer to fix styling
- Commit changes
  • Loading branch information
guanguans committed Jul 15, 2023
1 parent 231149d commit e6fd9f6
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
name: check & fix styling

on: [push, pull_request]
on: [ push ]

jobs:
php-cs-fixer:
name: php-cs-fixer
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
ref: ${{ github.head_ref }}
php-version: '7.2'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
- name: Cache composer dependencies
uses: actions/cache@v3
with:
args: --config=.php-cs-fixer.php --allow-risky=yes
path: vendor
key: composer-${{ hashFiles('composer.lock') }}

- name: Run composer install
run: composer install --no-interaction --prefer-dist --ansi -v

- name: Run php-cs-fixer
run: composer style-fix

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling
file_pattern: '**.php'

0 comments on commit e6fd9f6

Please sign in to comment.