-
Notifications
You must be signed in to change notification settings - Fork 1k
57 lines (52 loc) · 1.57 KB
/
lint.yml
File metadata and controls
57 lines (52 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Lint
on:
push:
branches: [ main ]
pull_request:
jobs:
php_cs_fixer:
name: PHP CS Fixer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
- name: Run Script
run: testing/run_cs_check.sh
php_code_sniffer:
name: PHP Code Sniffer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: Install Dependencies
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: composer global require squizlabs/php_codesniffer
- name: Run PHPCS Code Style Checker
run: ~/.composer/vendor/bin/phpcs --standard=phpcs-ruleset.xml -p -s
phpstan_static_analysis:
name: PHPStan Static Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
- name: Run Script
run: |
composer global require phpstan/phpstan
for dir in $(find * -type d -name src -not -path 'appengine/*' -not -path '*/vendor/*' -exec dirname {} \;);
do
composer install --working-dir=$dir --ignore-platform-reqs
echo "<?php require_once 'testing/sample_helpers.php';require_once '$dir/vendor/autoload.php';" > autoload.php
~/.composer/vendor/bin/phpstan analyse $dir/src --autoload-file=autoload.php
done