From 1a25184c952fa479001d24bfb6200d16c44cc97c Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Sat, 26 Oct 2024 08:03:06 -0400 Subject: [PATCH] Add lint action --- .github/workflows/lint.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..74bf9eb --- /dev/null +++ b/.github/workflows/lint.yml @@ -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/ ./