Lint on github actions

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2020-02-09 18:13:30 +01:00
parent 9205a21088
commit 64665c98e1
No known key found for this signature in database
GPG key ID: F941078878347C0C
3 changed files with 41 additions and 33 deletions

View file

@ -60,30 +60,15 @@ trigger:
- pull_request - pull_request
- push - push
--- #---
kind: pipeline #kind: pipeline
name: syntax-and-phan #name: syntax-and-phan
#
steps: #steps:
- name: submodules #- name: submodules
image: docker:git # image: docker:git
commands: # commands:
- git submodule update --init # - git submodule update --init
- name: syntax-php7.2
image: nextcloudci/php7.2:php7.2-13
commands:
- composer install
- ./lib/composer/bin/parallel-lint --exclude lib/composer/jakub-onderka/ --exclude 3rdparty/symfony/polyfill-php70/Resources/stubs/ --exclude 3rdparty/patchwork/utf8/src/Patchwork/Utf8/Bootup/ --exclude lib/composer/composer/autoload_static.php --exclude 3rdparty/composer/autoload_static.php --exclude 3rdparty/doctrine/cache/lib/Doctrine/Common/Cache/RiakCache.php .
- name: syntax-php7.3
image: nextcloudci/php7.3:php7.3-4
commands:
- composer install
- ./lib/composer/bin/parallel-lint --exclude lib/composer/jakub-onderka/ --exclude 3rdparty/symfony/polyfill-php70/Resources/stubs/ --exclude 3rdparty/patchwork/utf8/src/Patchwork/Utf8/Bootup/ --exclude 3rdparty/paragonie/random_compat/lib/ --exclude lib/composer/composer/autoload_static.php --exclude 3rdparty/composer/autoload_static.php --exclude 3rdparty/doctrine/cache/lib/Doctrine/Common/Cache/RiakCache.php .
- name: syntax-php7.4
image: nextcloudci/php7.4:2
commands:
- composer install
- ./lib/composer/bin/parallel-lint --exclude lib/composer/jakub-onderka/ --exclude 3rdparty/symfony/polyfill-php70/Resources/stubs/ --exclude 3rdparty/patchwork/utf8/src/Patchwork/Utf8/Bootup/ --exclude 3rdparty/paragonie/random_compat/lib/ --exclude lib/composer/composer/autoload_static.php --exclude 3rdparty/composer/autoload_static.php --exclude 3rdparty/doctrine/cache/lib/Doctrine/Common/Cache/RiakCache.php .
#- name: phan #- name: phan
# image: nextcloudci/php7.2:php7.2-13 # image: nextcloudci/php7.2:php7.2-13
# commands: # commands:
@ -91,14 +76,14 @@ steps:
# - composer require --dev "phan/phan:0.11.1" # - composer require --dev "phan/phan:0.11.1"
# - ./lib/composer/phan/phan/phan -k build/.phan/config.php # - ./lib/composer/phan/phan/phan -k build/.phan/config.php
# - php ./build/.phan/plugin-checker.php # - php ./build/.phan/plugin-checker.php
#
trigger: #trigger:
branch: # branch:
- master # - master
- stable* # - stable*
event: # event:
- pull_request # - pull_request
- push # - push
--- ---
kind: pipeline kind: pipeline

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

@ -0,0 +1,20 @@
name: Lint
on: pull_request
jobs:
php-linters:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['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

View file

@ -16,5 +16,8 @@
"require-dev": { "require-dev": {
"jakub-onderka/php-parallel-lint": "^0.9.2", "jakub-onderka/php-parallel-lint": "^0.9.2",
"jakub-onderka/php-console-highlighter": "^0.3.2" "jakub-onderka/php-console-highlighter": "^0.3.2"
} },
"scripts": {
"lint": "find . -name \\*.php -not -path './lib/composer/*' -exec php -l \"{}\" \\;"
}
} }