]> git.mxchange.org Git - friendica.git/blob - .github/workflows/lint.yml
Merge pull request #10239 from nupplaphil/feat/drone_lint
[friendica.git] / .github / workflows / lint.yml
1 name: Lint
2 on: pull_request
3
4 jobs:
5   php-cs-fixer:
6     name: php-cs check
7     runs-on: ubuntu-latest
8     steps:
9       - name: Checkout
10         uses: actions/checkout@v2
11       - name: Get changed files
12         id: changes
13         uses: jitterbit/get-changed-files@v1
14       - name: Set up php
15         uses: shivammathur/setup-php@master
16         with:
17           php-version: 7.2
18           coverage: none
19       - name: Install dependencies
20         run: bin/composer.phar run cs:install
21       - name: Run coding standards check
22         run: |
23           if ! echo "${{ steps.changes.outputs.added }}" | grep -qE "^(\\.php_cs(\\.dist)?|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${{ steps.changes.outputs.added }}"); else EXTRA_ARGS=''; fi
24           bin/dev/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --diff --diff-format=udiff --dry-run --stop-on-violation --using-cache=no ${EXTRA_ARGS}
25         shell: bash