Add CS workflows (#30)

This commit is contained in:
Alexey Kopytko 2021-01-01 20:11:42 +09:00 committed by GitHub
parent 4cc9023ff1
commit c98a4309ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 1 deletions

38
.github/workflows/cs.yaml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Coding Standards
on:
pull_request:
push:
branches:
- main
- master
jobs:
coding-standards:
name: Coding Standards
runs-on: ubuntu-latest
env:
PHP_CS_FIXER_VERSION: v2.17.3
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
tools: php-cs-fixer:${{ env.PHP_CS_FIXER_VERSION }}
- name: Restore PHP-CS-Fixer cache
uses: actions/cache@v2
with:
path: .php_cs.cache
key: "php-cs-fixer"
restore-keys: "php-cs-fixer"
- name: Run PHP-CS-Fixer, version ${{ env.PHP_CS_FIXER_VERSION }}
run: |
php-cs-fixer fix --diff --diff-format=udiff --dry-run --verbose

View File

@ -10,6 +10,7 @@ php:
cache:
directories:
- $HOME/.composer/cache
- $HOME/.cache/cache
- build/cache
install:

View File

@ -36,7 +36,7 @@
"pear/pear-core-minimal": "^1.10"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"friendsofphp/php-cs-fixer": "^2",
"php-coveralls/php-coveralls": "^2.2",
"phpunit/phpunit": "<6.0"
},