Skip to content

Commit 2afca07

Browse files
authored
Merge pull request #415 from ONLYOFFICE/feature/action-linter
ci: linter actions
2 parents 62db166 + 9e160f8 commit 2afca07

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.github/workflows/lint-php.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [master]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
php-lint:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
php-versions: [ "8.0", "8.1", "8.2" ]
17+
name: php-lint
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
22+
- name: Set up php ${{ matrix.php-versions }}
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-versions }}
26+
coverage: none
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Lint
31+
run: |
32+
cd ${{ github.workspace }}
33+
find . -name \\*.php -not -path './lib/composer/*' -not -path './build/stubs/*' -print0 | xargs -0 -n1 php -l

.github/workflows/lint-phpcs.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [master]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
name: php-cs
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: '8.0'
22+
coverage: none
23+
tools: composer, cs2pr, phpcs
24+
- name: Run phpcs
25+
run: |
26+
phpcs --standard=PSR2 --extensions=php,module,inc,install --ignore=node_modules,bower_components,vendor,3rdparty --warning-severity=0 ./

0 commit comments

Comments
 (0)