-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
64 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,39 @@ | ||
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.3' | ||
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 --using-cache=no --diff --dry-run --ansi -v | ||
path: vendor | ||
key: composer-${{ hashFiles('composer.lock') }} | ||
|
||
- name: Run composer install | ||
run: composer install --no-interaction --prefer-dist --ansi -v | ||
|
||
- name: Run composer require friendsofphp/php-cs-fixer | ||
run: composer require friendsofphp/php-cs-fixer --no-interaction --prefer-dist --ansi -v | ||
|
||
- name: Run php-cs-fixer | ||
# run: composer style-fix | ||
run: ./vendor/bin/php-cs-fixer fix --using-cache=yes --config=.php-cs-fixer.php --ansi -v | ||
|
||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Fix styling | ||
file_pattern: '**.php' |
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: rector | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**.php' | ||
- '.github/**.yml' | ||
- '.github/**.yaml' | ||
- '*.xml' | ||
- '*.xml.dist' | ||
|
||
jobs: | ||
rector: | ||
name: rector | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.3' | ||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick | ||
coverage: none | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: composer-${{ hashFiles('composer.lock') }} | ||
|
||
- name: Run composer install | ||
run: composer install --no-interaction --prefer-dist --ansi -v | ||
|
||
- name: Run composer require rector/rector | ||
run: composer require rector/rector --no-interaction --prefer-dist --ansi -v | ||
|
||
- name: Run rector | ||
# run: composer rector-dry-run | ||
run: ./vendor/bin/rector --clear-cache --dry-run --ansi -v |