]> git.mxchange.org Git - friendica.git/blob - .github/workflows/lint.yml
Merge pull request #10178 from nupplaphil/fix/10174
[friendica.git] / .github / workflows / lint.yml
1 name: Lint
2 on: pull_request
3
4 jobs:
5   php-linters:
6     name: php${{ matrix.php-versions }} lint
7     runs-on: ubuntu-latest
8     strategy:
9       matrix:
10         php-versions: ['7.3', '7.4', '8.0']
11     steps:
12       - name: Checkout
13         uses: actions/checkout@v2
14       - name: Set up php${{ matrix.php-versions }}
15         uses: shivammathur/setup-php@master
16         with:
17           php-version: ${{ matrix.php-versions }}
18           coverage: none
19       - name: Lint
20         run: bin/composer.phar run lint
21
22   php-cs-fixer:
23     name: php-cs check
24     runs-on: ubuntu-latest
25     steps:
26       - name: Checkout
27         uses: actions/checkout@v2
28       - name: Get changed files
29         id: changes
30         uses: jitterbit/get-changed-files@v1
31       - name: Set up php
32         uses: shivammathur/setup-php@master
33         with:
34           php-version: 7.2
35           coverage: none
36       - name: Install dependencies
37         run: bin/composer.phar run cs:install
38       - name: Run coding standards check
39         run: |
40           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
41           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}
42         shell: bash