Lint #704
Workflow file for this run
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: Lint | |
on: [push, pull_request] | |
jobs: | |
eslint: | |
name: ESLint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install Dependencies | |
run: npm ci | |
- name: Run Lint | |
run: npm run lint:js | |
phpcs: | |
name: PHPCS | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP 7.4 | |
uses: shivammathur/setup-php@9882bed06691b3a085010c1602ce43ef18f15c5b # v2 | |
with: | |
php-version: '7.4' | |
- name: Get composer cache directory | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install composer packages | |
run: | | |
composer install --no-progress | |
composer require php-parallel-lint/php-parallel-lint | |
- name: Run Lint | |
run: | | |
vendor/bin/phpcs -p -s -n . --standard=./phpcs.xml --extensions=php | |
- name: Run PHP Syntax Lint | |
run: | | |
export PATH=$HOME/.composer/vendor/bin:$PATH | |
vendor/bin/parallel-lint --blame --exclude node_modules --exclude vendor . |