forked from netz98/n98-magerun2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move php-cs-fixer checks to own workflow
- Loading branch information
Showing
2 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
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
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
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 |