From c98a4309ace04414f1d7e72411bdd2f222d40382 Mon Sep 17 00:00:00 2001 From: Alexey Kopytko Date: Fri, 1 Jan 2021 20:11:42 +0900 Subject: [PATCH] Add CS workflows (#30) --- .github/workflows/cs.yaml | 38 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 1 + composer.json | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cs.yaml diff --git a/.github/workflows/cs.yaml b/.github/workflows/cs.yaml new file mode 100644 index 0000000..1c13a4a --- /dev/null +++ b/.github/workflows/cs.yaml @@ -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 diff --git a/.travis.yml b/.travis.yml index 43e88c6..796fc16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ php: cache: directories: - $HOME/.composer/cache + - $HOME/.cache/cache - build/cache install: diff --git a/composer.json b/composer.json index d98446c..1ae459d 100644 --- a/composer.json +++ b/composer.json @@ -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" },