diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml new file mode 100644 index 00000000..677424d0 --- /dev/null +++ b/.github/workflows/lint-php.yml @@ -0,0 +1,33 @@ +name: Lint + +on: + push: + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + php-lint: + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: [ "8.0", "8.1", "8.2" ] + name: php-lint + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + coverage: none + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Lint + run: | + cd ${{ github.workspace }} + find . -name \\*.php -not -path './lib/composer/*' -not -path './build/stubs/*' -print0 | xargs -0 -n1 php -l \ No newline at end of file diff --git a/.github/workflows/lint-phpcs.yml b/.github/workflows/lint-phpcs.yml new file mode 100644 index 00000000..e63a7781 --- /dev/null +++ b/.github/workflows/lint-phpcs.yml @@ -0,0 +1,26 @@ +name: Lint + +on: + push: + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + lint: + runs-on: ubuntu-latest + name: php-cs + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + coverage: none + tools: composer, cs2pr, phpcs + - name: Run phpcs + run: | + phpcs --standard=PSR2 --extensions=php,module,inc,install --ignore=node_modules,bower_components,vendor,3rdparty --warning-severity=0 ./ \ No newline at end of file