Run php linter on github actions

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2020-06-23 13:37:52 +02:00
parent f43ce8afbd
commit 8863b4fff9
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF
3 changed files with 41 additions and 1 deletions

36
.github/workflows/lint.yml vendored Normal file
View file

@ -0,0 +1,36 @@
name: Lint
on: pull_request
jobs:
php-linters:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.0', '7.1', '7.2', '7.3', 7.4]
name: php${{ matrix.php-versions }} lint
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up php${{ matrix.php-versions }}
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
coverage: none
- name: Lint
run: composer run lint
node-linters:
runs-on: ubuntu-latest
name: ESLint
steps:
- uses: actions/checkout@master
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: npm install
run: npm ci
- name: eslint
run: npm run lint
env:
CI: true

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
tests/clover.xml
.idea
node_modules/
js/
*.spec

View file

@ -13,5 +13,8 @@
"email": "jus@bitgrid.net"
}
],
"require": {}
"require": {},
"scripts": {
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l"
}
}