ci: add phpcs and eslint linting workflow
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["**"]
|
||||
pull_request:
|
||||
branches: ["**"]
|
||||
|
||||
jobs:
|
||||
php-lint:
|
||||
name: PHP (phpcs PSR-12)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install PHP_CodeSniffer
|
||||
run: |
|
||||
curl -sL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -o /usr/local/bin/phpcs
|
||||
chmod +x /usr/local/bin/phpcs
|
||||
|
||||
- name: Run phpcs
|
||||
run: phpcs --standard=.phpcs.xml .
|
||||
|
||||
js-lint:
|
||||
name: JS (eslint)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install ESLint
|
||||
run: npm install --save-dev eslint@8
|
||||
|
||||
- name: Run ESLint
|
||||
run: npx eslint assets/js/
|
||||
|
||||
Reference in New Issue
Block a user