feat: phpcs workflow #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHPCS Lint | |
on: [push, pull_request] | |
jobs: | |
phpcs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup PHP Action | |
uses: shivammathur/[email protected] | |
with: | |
php-version: '8.2.19' | |
tools: composer | |
- name: Configure Composer | |
run: composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true | |
- name: Install PHPCS and coding standards | |
run: | | |
composer global require "squizlabs/php_codesniffer=*" | |
composer global require drupal/coder | |
composer global require slevomat/coding-standard | |
- name: Configure PHPCS | |
run: ~/.composer/vendor/bin/phpcs --config-set installed_paths ~/.composer/vendor/drupal/coder/coder_sniffer,$HOME/.composer/vendor/slevomat/coding-standard | |
- name: Run PHPCS | |
run: ~/.composer/vendor/bin/phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme . |