diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..97c5c60ea --- /dev/null +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.gitignore b/.gitignore index b74e8dd7b..01cffe44f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ tests/clover.xml +.idea node_modules/ js/ *.spec diff --git a/composer.json b/composer.json index 1bffd061f..f07a6f54c 100644 --- a/composer.json +++ b/composer.json @@ -13,5 +13,8 @@ "email": "jus@bitgrid.net" } ], - "require": {} + "require": {}, + "scripts": { + "lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l" + } }