diff --git a/.github/workflows/php-lint.yml b/.github/workflows/php-lint.yml new file mode 100644 index 0000000..677ad87 --- /dev/null +++ b/.github/workflows/php-lint.yml @@ -0,0 +1,37 @@ +name: Check for syntax errors on different PHP version + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + run: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: [ubuntu-latest] + php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] + name: PHP ${{ matrix.php-versions }} Lint on ${{ matrix.operating-system }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + + - name: Check PHP Version + run: php -v + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-plugins + + - name: Run lint + run: ./vendor/bin/phplint path src + diff --git a/.gitignore b/.gitignore index 45574d3..fbd7343 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ phpunit.phar /tests/docker /tests/dockerids +/.phplint.cache diff --git a/composer.json b/composer.json index a18a51d..b9640d9 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "keywords": ["yii2", "authclient", "oauth", "gitlab"], "homepage": "http://github.com/yiiauth/gitlab", "require": { - "php": "~7.3 || 8.0", + "php": "~7.3 || ~8.0", "yiisoft/yii2-authclient": "~2.1" }, "license": "MIT", @@ -24,5 +24,8 @@ "type": "composer", "url": "https://asset-packagist.org" } - ] + ], + "require-dev": { + "overtrue/phplint": "*" + } }