Skip to content

Commit

Permalink
Move php-cs-fixer checks to own workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cmuench committed Apr 27, 2024
1 parent 564ad33 commit 0501a1a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/magento_platform_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@ jobs:
# everything from scratch for every new branch.
run: composer install --no-interaction --prefer-dist --no-progress --no-suggest

- name: Run php-cs-fixer
run: vendor/bin/php-cs-fixer fix --diff --dry-run

- name: Setup Magento Open Source Repository Credentials
run: |
composer global config http-basic.repo.magento.com "${MAGENTO_MARKETPLACE_USERNAME}" "${MAGENTO_MARKETPLACE_PASSWORD}";
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/php-code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Code Style
on:
push:
paths:
- "src/**"
pull_request:
paths:
- "src/**"

jobs:
php-cs-fixer:
name: PHP CS Fixer
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/[email protected]
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout HEAD
uses: actions/[email protected]
if: github.event_name == 'push'
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
tools: composer:2.2.17, cs2pr
php-version: 8.2
extensions: mcrypt, mbstring, intl
coverage: none
- name: Install dependencies
# If we have a very broad restore-keys in the previous caching action,
# we might pull outdated dependencies from a parent branch for new branches.
# Over time, just running composer all the time to give it a chance
# to fix the outdated dependencies should be faster than having to pull
# everything from scratch for every new branch.
run: composer install --no-interaction --prefer-dist --no-progress --no-suggest

- name: Run php-cs-fixer
run: vendor/bin/php-cs-fixer fix --diff --dry-run

0 comments on commit 0501a1a

Please sign in to comment.