Skip to content

Commit

Permalink
Add lint action
Browse files Browse the repository at this point in the history
  • Loading branch information
joecorall committed Oct 26, 2024
1 parent e972517 commit 1a25184
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: lint

on:
push:
branches:

jobs:
phpcs:
name: Run PHPCS with Drupal Standards
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up PHP and Composer
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: phpcs
coverage: none

- name: Install Drupal Coder Standards
run: |
composer global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer global require --no-interaction drupal/coder slevomat/coding-standard
COMPOSER_HOME=$(composer config --global home)
phpcs --config-set installed_paths \
"$COMPOSER_HOME/vendor/drupal/coder/coder_sniffer,$COMPOSER_HOME/vendor/slevomat/coding-standard"
phpcs -i
- name: Run PHPCS
run: phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme --ignore=vendor/ ./

- name: Run DrupalPractice
run: phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme --ignore=vendor/ ./

0 comments on commit 1a25184

Please sign in to comment.