Skip to content

Commit

Permalink
[CI] Move php-cs-fixer out of dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ogizanagi committed Nov 16, 2021
1 parent 33cfb10 commit ac51e24
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
17 changes: 3 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,11 @@ jobs:
with:
php-version: '8.0'

- name: 'Get composer cache directory'
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: 'Cache dependencies'
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: 'Install dependencies'
run: composer update --prefer-dist
run: make php-cs-fixer.phar

- name: 'Check style'
run: vendor/bin/php-cs-fixer fix --dry-run --no-interaction --diff
run: ./php-cs-fixer.phar fix --dry-run --no-interaction --diff

test:
name: ${{ matrix.name }}
Expand Down Expand Up @@ -153,7 +142,7 @@ jobs:
if: ${{ matrix.allow-unstable }}

- name: 'Remove packages not allowing Symfony 6 yet'
run: composer remove --no-update ${{ matrix.composer-flags }} --dev --no-interaction --ansi "nelmio/alice" "api-platform/core" "friendsofphp/php-cs-fixer"
run: composer remove --no-update ${{ matrix.composer-flags }} --dev --no-interaction --ansi "nelmio/alice" "api-platform/core"
if: ${{ matrix.symfony == '6.0.*@dev' }}

- name: 'Require Doctrine MongoDB dependencies'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/vendor
/composer.lock
.php-cs-fixer.cache
php-cs-fixer.phar
.phpunit.result.cache
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
PHP_CS_FIXER_VERSION=v3.3.2

###########
# Install #
###########
Expand Down Expand Up @@ -39,7 +41,7 @@ install-61:

remove-60unready-deps:
# Tmp remove packages not allowing Symfony 6 yet
composer remove --no-update --no-interaction --dev "nelmio/alice" "api-platform/core" "friendsofphp/php-cs-fixer"
composer remove --no-update --no-interaction --dev "nelmio/alice" "api-platform/core"

add-odm:
composer require --no-update --no-interaction --dev "doctrine/mongodb-odm:^2.2" "doctrine/mongodb-odm-bundle:^4.3"
Expand All @@ -65,8 +67,18 @@ testdox:

lint: lint-php-cs-fixer

php-cs-fixer.phar:
wget --no-verbose https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/${PHP_CS_FIXER_VERSION}/php-cs-fixer.phar
chmod +x php-cs-fixer.phar

update-php-cs-fixer.phar:
rm -f php-cs-fixer.phar
make php-cs-fixer.phar

fix-php-cs-fixer: php-cs-fixer.phar
fix-php-cs-fixer:
vendor/bin/php-cs-fixer fix --no-interaction
./php-cs-fixer.phar fix --no-interaction

lint-php-cs-fixer: php-cs-fixer.phar
lint-php-cs-fixer:
vendor/bin/php-cs-fixer fix --no-interaction --dry-run --diff
./php-cs-fixer.phar fix --no-interaction --dry-run --diff
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"doctrine/data-fixtures": "^1.2",
"doctrine/doctrine-bundle": "^1.12|^2.0",
"doctrine/orm": "^2.4",
"friendsofphp/php-cs-fixer": "^3.0",
"nelmio/alice": "^3.0",
"symfony/browser-kit": "^4.4|^5.1|^6.0",
"symfony/console": "^4.4|^5.1|^6.0",
Expand Down

0 comments on commit ac51e24

Please sign in to comment.