-
Notifications
You must be signed in to change notification settings - Fork 20
49 lines (38 loc) · 1.72 KB
/
phpcs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Drupal coding standards
on:
# Run on all pushes and on all pull requests.
# Prevent the build from running when there are only irrelevant changes.
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
# Allow manually triggering the workflow.
workflow_dispatch:
jobs:
Verify:
name: "Verify Drupal coding standards"
runs-on: "ubuntu-latest"
env:
PHP_VERSION: "7.4"
CODE_SNIFFER_PATH: "droopler.* src/ modules/custom/ themes/custom/"
CODE_SNIFFER_IGNORE: "*md,*.css,*.txt,*.info,*interactive_ui/react_slider/js*,*pl-sk/*,*pattern-lab/*,*_twig-components/*"
CODE_SNIFFER_EXTENSIONS: "php,inc,install,module,yaml,yml,theme,profile"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none
tools: composer, phpcs
- name: Allow phpcs composer installer
run: composer config --global --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
- name: Download Drupal coding standards
run: composer global require --no-progress --no-suggest --no-scripts --no-plugins --optimize-autoloader slevomat/coding-standard:^7.0 drupal/coder
- name: Add Drupal coding standards to phpcs
run: phpcs --config-set installed_paths $HOME/.composer/vendor/drupal/coder/coder_sniffer,$HOME/.composer/vendor/slevomat/coding-standard
- name: Verify coding standards
run: phpcs ${{ env.CODE_SNIFFER_PATH }} --ignore=${{ env.CODE_SNIFFER_IGNORE }} --extensions=${{ env.CODE_SNIFFER_EXTENSIONS}} --standard=Drupal --report=full,gitblame